this.
s
t
o
r
e
.
d
i
s
p
a
t
c
h
:
含
有
异
步
操
作
,
例
如
向
后
台
提
交
数
据
,
写
法
:
t
h
i
s
.
store.dispatch:含有异步操作,例如向后台提交数据,写法: this.
store.dispatch:含有异步操作,例如向后台提交数据,写法:this.store.dispatch(‘action方法名’,值)
this.
s
t
o
r
e
.
c
o
m
m
i
t
:
同
步
操
作
,
写
法
:
t
h
i
s
.
store.commit:同步操作,写法:this.
store.commit:同步操作,写法:this.store.commit(‘mutations方法名’,值)
vuex中this.$store.dispatch和this.$store.commit的区别(都是调用vuex中的方法。一个异步一个同步)
最新推荐文章于 2023-09-13 11:37:59 发布