Add页面console 报错

来源:4-4 单页面应用 Demo2(1)

weixin_慕哥0598824

2019-05-04 18:29

[vuex] unknown mutation type: addItem 


点添加后vue调试插件 lists:Array[0]


这是什么情况啊 


写回答 关注

3回答

  • Brian
    2019-05-08 11:04:18

    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'
      }
    }


  • weixin_慕哥0598824
    2019-05-04 18:55:31

    IDe管了ESLint 就好了,真见鬼~耗一下午时间

  • weixin_慕哥0598824
    2019-05-04 18:43:20

    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


3小时速成 Vue2.x 核心技术

带你快速学习最流行的前端框架vue2.x的核心技术

82558 学习 · 487 问题

查看课程

相似问题