https://codesandbox.io/s/wn8ovky868
Open index page then click to link "Go to the test page".
In console will "undefined".
But when you just open "/test" in browser you will see "ace" object in console.
ace object in console
ace object is undefined
Hi there,
I tried your code, as you can see in network tab, ace is correctly loaded and nuxt does its part.
You're trying to use an asynchronously loaded script which you don't know if it's actually really loaded at vue mounted lifecycle hook.
You could do this :
https://codesandbox.io/s/jvp7o9z0ny
@Atinux I'll open an feature request in vue-meta because we can't simply put an onload event using a component method like :
{
src: "https://cdnjs.cloudflare.com/ajax/libs/ace/1.2.9/ace.js",
async: true,
onload: this.myMethod // method isn't window exposed so it's "normal" but it could be better
}
Thanks for your contribution to Nuxt.js!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you would like this issue to remain open:
Issues that are labeled as 馃晲Pending will not be automatically marked as stale.
@benoitemile Feel free to raise an issue or send in a PR on https://github.com/nuxt/vue-meta :relaxed:
Thanks for your contribution to Nuxt.js!
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs.
If you would like this issue to remain open:
Issues that are labeled as 馃晲Pending will not be automatically marked as stale.
Most helpful comment
Hi there,
I tried your code, as you can see in network tab, ace is correctly loaded and nuxt does its part.
You're trying to use an asynchronously loaded script which you don't know if it's actually really loaded at vue mounted lifecycle hook.
You could do this :
https://codesandbox.io/s/jvp7o9z0ny
@Atinux I'll open an feature request in vue-meta because we can't simply put an onload event using a component method like :