vue-meta
vue-meta copied to clipboard
Suggested improvements to documentation for "callback" and "skip"
-
In the documentation please explain how a script element in the array is triggered by the change in value of the "skip" expression. Are you periodically polling? Are you injecting a callback on each of the "callback"s and in the callback you are reevaluating all of the "skip" expressions? If we don't explain the mechanism it seems like magic and personally I didn't use this feature because I didn't understand how it works.
-
Can we rename "skip" to maybe "wait"? I think "wait" captures the meaning that this expression will be reevaluated.
-
Maybe have the example be something like this. Seems like this is the most common use case maybe? How about two examples?
script: [
{
src: "/js/partOne.js",
hid: "partOne",
callback: () => {
this.readyForPartTwo = true;
},
},
{
src: "/js/partTwoRequiresPartOne.js",
skip: !this.readyForPartTwo,
},
],
Its probably better explained (by example) by looking at this example: https://github.com/nuxt/vue-meta/blob/master/examples/async-callback/app.js
I might consider renaming these props for v3