vue ssr introduces carousel plug-in to report error: window is not defined;
the solution given in the official document is not quite clear: https://zh.nuxtjs.org/faq/win.
1:
.vue
2:external_library
nuxt.config.js external_library
vue ssr introduces carousel plug-in to report error: window is not defined;
the solution given in the official document is not quite clear: https://zh.nuxtjs.org/faq/win.
1:
.vue
2:external_library
nuxt.config.js external_library
if (process.BROWSER_BUILD) {
require('external_library')
}
process.BROWSER_BUILD
determine whether it is on the client
external_library
refers to the module you want to apply
nuxt2
can be obtained globally via process.browser
.
if (process.browser) {
require('external_library')
}
and vendor: ['element-ui','external_library']
this has been removed from 2 without configuration.
Previous: My typeof is an obj, but I. ID is the boss of undefende. Show me this data structure.
Next: How to configure the js file generated by iview-admin build