【发布时间】:2021-05-07 23:24:12
【问题描述】:
好吧,我在浏览器控制台中有这个警告:
[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,这没有帮助。 提前感谢您的帮助。
【问题讨论】:
-
其实vue3已经发布了。很多事情都变了。 BeforeDestroy Lifecycle hook 已重命名为 beforeUnmount...所有生命周期 hhok 都在这里:(v3.vuejs.org/guide/composition-api-lifecycle-hooks.html)
-
好的,但我有Vue3,这就是我不明白的......
-
你想用 vue2 创建项目吗?您的 package.json 请求 vue.js 的确切版本。而且这个版本不是第二版
-
不,我正在使用完整的 VueJS 3.0。
-
可能您的依赖项之一不适用于 vue3
标签: vuejs3