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:
1. If I enter the About Page
directly through http://domain/about, all works well
2. If I enter the About Page
from Index Page
through <nuxt-link to="/about">
, I can not use the exposed function from example.js
, because the js file didn't download yet when mounted
was invoked, I also tried window.onload
which the function inside won't be invoked.
So is there a hook existent which will be invoked after external libraries finish download?
<!--cmty--><!--cmty_prevent_hook--><div align="right"><sub><em>This question is available on <a href="https://nuxtjs.cmty.io">Nuxt.js</a> community (<a href="https://nuxtjs.cmty.io/nuxt/nuxt.js/issues/c886">#c886</a>)</em></sub></div>