[Vuejs]-Vuex problems, important project, MapActions,MapGetters

0πŸ‘

βœ…

On home page you should add

created() {
    this.$store.dispatch('SET_MESSAGE');
}

This code will call SET_MESSAGE

computed: {
    ...mapGetters({
        message: 'message',
    }),
}

After adding this part you can take message value simple call "this.message" in methods or "message" in template

Leave a comment