使用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))
}
- 1 回答
- 0 關注
- 828 瀏覽
添加回答
舉報
0/150
提交
取消