为了账号安全,请及时绑定邮箱和手机立即绑定

使用Vuex中的 mapMutations 辅助函数时怎么传递参数

使用Vuex中的 mapMutations 辅助函数时怎么传递参数

慕勒3428872 2018-11-26 00:00:31
使用Vuex中的 mapMutations 辅助函数时怎么传递参数
查看完整描述

1 回答

?
守着星空守着你

TA贡献1799条经验 获得超8个赞

this.increment({ amount: 10 }) 或 this.add({ amount: 10 })
以例子中method的increment方法为例:
increment(...args){
return this.$store.dispatch.apply(this.$store,['incrememt'].concat(args))
}

查看完整回答
反对 回复 2018-12-18
  • 1 回答
  • 0 关注
  • 763 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信