Vue.js Vuejs(vuex)错误未知的局部变异类型

Vue.js Vuejs(vuex)错误未知的局部变异类型,vue.js,vuex,Vue.js,Vuex,我在注册页面输入时出错。错误是这样的: unknown local mutation type: setRegisterEmail, global type: authentication/setRegisterEmail 我尝试了很多方法,但仍然无法修复它 这是我的register.vue: Import { mapState, mapMutations, mapActions } from 'vuex'; export default { computed: { ...mapS

我在注册页面输入时出错。错误是这样的:

unknown local mutation type: setRegisterEmail, global type: authentication/setRegisterEmail
我尝试了很多方法,但仍然无法修复它

这是我的register.vue:

Import { mapState, mapMutations, mapActions } from 'vuex';
export default {
  computed: {
    ...mapState('authentication', [
      'registerEmail',
      'registerPassword',
      'registerError',
    ]),
  },
  methods: {
    ...mapMutations('authentication', [
      'setRegisterEmail',
      'setRegisterPassword',
    ]),
    ...mapActions('authentication', [
      'register',
    ]),
  },
};
这是我的autentication.js:

export default {
    namespaced: true,
    state: {
        registerEmail: null,
        registerPassword: null,
        registerError: null,
        token: null,
    },
    mutation: {
        setToken(state, token) {
            state.token = token;
        },
        setRegisterEmail(state, email) {
            state.registerEmail = email;
        },
        setRegisterPassword(state, password) {
            state.registerPassword = password;
        },
    },
};

您的authentication.js中有一个输入错误。用突变替换突变

lol好吧,谢谢你,我是vuejs新手,我试着在3小时内找出错误。谢谢你。我会记下这个答案