我在我的应用程序中使用 vue-confetti 包,但它在构建时给出了以下错误,我想知道如何克服这个错误,如何让它只使用 Gridsome 在客户端呈现。
ReferenceError: window is not defined
at Object.<anonymous> (node_modules/vue-confetti/dist/vue-confetti.js:1:210)
at __webpack_require__ (webpack/bootstrap:25:0)
at Module.<anonymous> (assets/js/app.1b103b72.js:43910:20)
at __webpack_require__ (webpack/bootstrap:25:0)
at Object.module.exports.module.exports (assets/js/app.1b103b72.js:5973:18)
at __webpack_require__ (webpack/bootstrap:25:0)
at assets/js/app.1b103b72.js:118:18
at Object.<anonymous> (assets/js/app.1b103b72.js:121:10)
at o (D:\angular\climber-website\node_modules\vue-server-renderer\build.prod.js:1:77543)
at D:\angular\climber-website\node_modules\vue-server-renderer\build.prod.js:1:78136```
[1]: https://www.npmjs.com/package/vue-confetti