vue2只适应vuex 3.x和vue-router 3.x
说明
最近实现一个 springboot + vue 的登录案例 , 发现 vuex 和 vue-router 都是用不了
之前整理了 vue2 不能使用 vue-router 4.x
具体参考
https://blog.csdn.net/shaoming314/article/details/123721399?spm=1001.2014.3001.5501
问题在线
配置文件 packag.json
"dependencies": {
"axios": "^0.26.1",
"core-js": "^3.6.5",
"element-ui": "^2.15.6",
"vue": "^2.6.11",
"vue-router": "^4.0.14",
"vuex": "^4.0.2"
},
解决问题
修改后的配置文件 package.json 文件 如下
"dependencies": {
"axios": "^0.26.1",
"core-js": "^3.6.5",
"vue": "^2.6.11",
"vue-router": "^3.0.6",
"vuex": "^3.1.0"
},
注意
修改之后重新编译运行
npm install
重新安装项目依赖