奇怪的 vue 警告:`beforeDestroy` 已重命名为 `beforeUnmount`
Strange vue warn: `beforeDestroy` has been renamed to `beforeUnmount`
嗯,我在浏览器控制台中有这个警告:
[Vue warn]: `beforeDestroy` has been renamed to `beforeUnmount`.
在
这很奇怪,因为我没有 beforeDestroy
任何地方,而且我的 package.json:
中有最新版本的软件包
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"axios": "^0.21.1",
"core-js": "^3.6.5",
"moment": "^2.29.1",
"quill": "^1.3.7",
"register-service-worker": "^1.7.1",
"socket.io-client": "^3.1.0",
"three": "^0.123.0",
"uuid": "^3.4.0",
"v-calendar": "^3.0.0-alpha.3",
"vue": "^3.0.5",
"vue-dk-toast": "^1.3.3",
"vue-material-design-icons": "^4.11.0",
"vue-router": "^4.0.4",
"vue-socket.io": "^3.0.10",
"vue-uuid": "^2.0.2",
"vue3-carousel": "^0.1.11",
"vue3-quill": "^0.2.1",
"vuex": "^4.0.0-0"
},
"devDependencies": {
"@babel/core": "^7.12.17",
"@babel/eslint-parser": "^7.12.1",
"@vue/cli-plugin-babel": "^4.5.10",
"@vue/cli-plugin-eslint": "^4.5.10",
"@vue/cli-plugin-pwa": "^4.5.11",
"@vue/cli-plugin-router": "^4.5.11",
"@vue/cli-plugin-vuex": "~4.5.0",
"@vue/cli-service": "^4.5.11",
"@vue/compiler-sfc": "^3.0.5",
"@vue/eslint-config-airbnb": "^5.0.2",
"eslint": "^6.8.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-vue": "^7.6.0"
}
有什么问题吗?我搜索了同样的问题,但我只发现了这个: https://github.com/ckeditor/ckeditor5/issues/8224 ,这没有帮助。
预先感谢您的帮助。
您拥有“所有最高版本的软件包”这一事实与“我正在使用的所有软件包都与 Vue 3 兼容”有很大不同....很明显其中一个软件包绝对不兼容Vue 3...
我遇到了类似的问题。我想是因为 vue-socket.io
与 Vue3 不兼容。以下是我的解决方案。
更新为vue-3-socket.io
,这是vue-socket.io
的Vue 3兼容版本(尽管它仍然不能完全兼容Vue3)
然后打开文件node_modules/vue-3-socket.io/dist/vue-socketio.js
搜索beforeDestroy
并将其替换为beforeUnmount
嗯,我在浏览器控制台中有这个警告:
[Vue warn]: `beforeDestroy` has been renamed to `beforeUnmount`.
在
这很奇怪,因为我没有 beforeDestroy
任何地方,而且我的 package.json:
"scripts": {
"serve": "vue-cli-service serve",
"build": "vue-cli-service build",
"lint": "vue-cli-service lint"
},
"dependencies": {
"axios": "^0.21.1",
"core-js": "^3.6.5",
"moment": "^2.29.1",
"quill": "^1.3.7",
"register-service-worker": "^1.7.1",
"socket.io-client": "^3.1.0",
"three": "^0.123.0",
"uuid": "^3.4.0",
"v-calendar": "^3.0.0-alpha.3",
"vue": "^3.0.5",
"vue-dk-toast": "^1.3.3",
"vue-material-design-icons": "^4.11.0",
"vue-router": "^4.0.4",
"vue-socket.io": "^3.0.10",
"vue-uuid": "^2.0.2",
"vue3-carousel": "^0.1.11",
"vue3-quill": "^0.2.1",
"vuex": "^4.0.0-0"
},
"devDependencies": {
"@babel/core": "^7.12.17",
"@babel/eslint-parser": "^7.12.1",
"@vue/cli-plugin-babel": "^4.5.10",
"@vue/cli-plugin-eslint": "^4.5.10",
"@vue/cli-plugin-pwa": "^4.5.11",
"@vue/cli-plugin-router": "^4.5.11",
"@vue/cli-plugin-vuex": "~4.5.0",
"@vue/cli-service": "^4.5.11",
"@vue/compiler-sfc": "^3.0.5",
"@vue/eslint-config-airbnb": "^5.0.2",
"eslint": "^6.8.0",
"eslint-plugin-import": "^2.22.1",
"eslint-plugin-vue": "^7.6.0"
}
有什么问题吗?我搜索了同样的问题,但我只发现了这个: https://github.com/ckeditor/ckeditor5/issues/8224 ,这没有帮助。 预先感谢您的帮助。
您拥有“所有最高版本的软件包”这一事实与“我正在使用的所有软件包都与 Vue 3 兼容”有很大不同....很明显其中一个软件包绝对不兼容Vue 3...
我遇到了类似的问题。我想是因为 vue-socket.io
与 Vue3 不兼容。以下是我的解决方案。
更新为
vue-3-socket.io
,这是vue-socket.io
的Vue 3兼容版本(尽管它仍然不能完全兼容Vue3)然后打开文件
node_modules/vue-3-socket.io/dist/vue-socketio.js
搜索
beforeDestroy
并将其替换为beforeUnmount