报错commit undefine,发现store也undefined了,可是明明已经全局引入了,该export也export了,怎么还会错呢。
最后在package.json发现版本不对。
vue2 vuex3
vue3 vuex4
但是删掉了原本的vuex再下载对应版本之后还是报错,node-module又缺少xx包了。
直接删掉node-module(rimraf node_modules)再重新下(npm i),这下终于对了。
关于this.$store为undefined
于 2022-11-10 20:30:01 首次发布