Vue中的错误提示
WARNING Compiled with 3 warnings 下午3:34:08
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 'reactive' (imported as 'reactive') 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)
这是原因是因为:Vue的版本和Vuex的版本不匹配。
正确的版本应该是:
Vue | Vuex |
---|---|
2 | 3 |
3 | 4 |
解决办法:
npm uninstall vuex
cnpm install vuex@3
然后就解决了。