nuxt
nuxt copied to clipboard
If you jump from a page that has not introduced a module to a page that has introduced a module in the form of CDN, an error will be reported
For example, I have three routing pages: / A, / B, / C
I did not introduce echarts.js in the form of CDN on the / A and / b pages; However, I introduced it locally on the / C page
<script>
export default{
head: {
script: [{
src: 'https://www.xxx.xxx/echarts.min.js'
}]
},
}
</script>
At this time, if I forcibly refresh the page on any page of a and B (Ctrl + F5); When you jump to page C, the following error will be reported:
An error occurred while showing the error page
Unfortunately an error occurred and while showing the error page another error occurred
Error details: ReferenceError: echarts is not defined
[Go back to home](http://192.168.0.100:1258/)
I noticed that this was caused by not reloading the CDN JS in the head after switching the route. I want to know how to solve this problem