hooks for external libraries
[issue link]Hi I am using v1.0.0-alpha.4
Let’s say we can use below syntax to implement an external library
head: {
script: [
{ src: '/example.js' } // this file is in static
]
}
I wanna use this library in special page, for instance in About Page, so I can put this snippet in layouts/about.vue or page/about.vue (actually both had been tried)
The scenario is:
- If I enter the
About Pagedirectly through http://domain/about, all works well - If I enter the
About PagefromIndex Pagethrough<nuxt-link to="/about">, I can not use the exposed function fromexample.js, because the js file didn’t download yet whenmountedwas invoked, I also triedwindow.onloadwhich the function inside won’t be invoked.
So is there a hook existent which will be invoked after external libraries finish download?