dispatch:含有异步操作,

存储:

this.$store.dispatch('setTargetUser',friend);

取值:

this.$store.getters.targetUser;

commit:同步操作,

存储:

this.$store.commit('setTargetUser',friend);

取值:

this.$store.state.setTargetUser

 

Logo

前往低代码交流专区

更多推荐