[Vuejs]-Make sure that this property is reactive, either in the data option, or for class-based components, by initializing the property. Vuex

1πŸ‘

βœ…

It looks like you tried to map setRegisterEmail in your component, but you’ve incorrectly added it to the root of the component definition:

export default {
    // ❌ invalid component option
    ...mapMutations('authentication', [
        'setRegisterEmail',
        'setRegisterPassword',
    ]),
    // ❌ invalid component option
    ...mapActions('authentication', [
        'register',
    ]),
};

To properly map mutations and actions with mapMutations and mapActions, put them under the methods option:

export default {
       πŸ‘‡
    methods: {
        ...mapMutations('authentication', [
            'setRegisterEmail',
            'setRegisterPassword',
        ]),
        ...mapActions('authentication', [
            'register',
        ]),
    }
};
πŸ‘€tony19

Leave a comment