vue与vuex版本不吻合发出的警告

  "dependencies": {

        "@jiaminghi/charts": "^0.2.18",

        "@jiaminghi/data-view": "^2.10.0",

        "echarts": "^4.9.0",

        "vue": "^2.5.2",

        "vue-router": "^3.0.1",

        "vuex": "^3.6.2"

      },

npm install vuex@3.6.2 --save(vuecli2)

安装vuex之后执行npm run serve测试时出现警告

 WAIT  Compiling...                                                                                                                              07:00:18
 
Compiling...
 
 
 WARNING  Compiled with 4 warnings                                                                                                               07:00:18
 
 warning  in ./node_modules/vuex/dist/vuex.esm-bundler.js
 
export 'inject' (imported as 'inject') was not found in 'vue' (possible exports: default)
 
 warning  in ./node_modules/vuex/dist/vuex.esm-bundler.js
 
export 'watch' (imported as 'watch') was not found in 'vue' (possible exports: default)
 
 warning  in ./node_modules/vuex/dist/vuex.esm-bundler.js
 
 
 warning  in ./node_modules/vuex/dist/vuex.esm-bundler.js
 
export 'reactive' (imported as 'reactive') was not found in 'vue' (possible exports: default)
原因大概是安装vuex的时候填入了小版本号导致与vue2版本不匹配

卸载原有版本,重新安装即可

npm uninstall vuex
npm install vuex@3
————————————————
版权声明:本文为CSDN博主「oTingShuo123」的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
原文链接:https://blog.csdn.net/oTingShuo123/article/details/123103197