[vuex] unknown mutation type: addItem
点添加后vue调试插件 lists:Array[0]
这是什么情况啊
ESLint最好是打开,可以参考一下如下的配置:
module.exports = {
root: true,
env: {
node: true
},
'extends': [
'plugin:vue/essential',
'@vue/standard'
],
rules: {
'no-console': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'no-debugger': process.env.NODE_ENV === 'production' ? 'error' : 'off',
'quotes': ["error", "single", { "avoidEscape": true }],
'vue/script-indent': ['error', 2, {'baseIndent': 1, "switchCase": 1}],
'indent': ["error", 2, { "SwitchCase": 1 }],
"comma-dangle": ["error", "only-multiline"]
// 'indent': 'off',
},
'overrides': [
{
'files': ['*.vue'],
'rules': {
'indent': 0
}
}
],
parserOptions: {
parser: 'babel-eslint'
}
}能提供代码吗?
包括且不限于:
1. webpack版本,vue版本,node版本,npm版本。
2. webpack配置;
3. package.json
4. 本课程中的哪个实例操作出如上的错误,操作的流程是什么?!
5. 代码截图,console错误截图,终端错误截图。
IDe管了ESLint 就好了,真见鬼~耗一下午时间
vuex.esm.js?358c:376 [vuex] unknown mutation type: addItem
commit @ vuex.esm.js?358c:376
boundCommit @ vuex.esm.js?358c:325
add @ Add.vue?e2ad:25
click @ Add.vue?4187:58
invokeWithErrorHandling @ vue.esm.js?efeb:1863
invoker @ vue.esm.js?efeb:2188
original._wrapper @ vue.esm.js?efeb:7559