从另一个动作中调用一个动作 - Call an action from within another action

问题:

I have the following setup for my actions:我的操作有以下设置:

get1: ({commit}) => {
  //things
  this.get2(); //this is my question!
},
get2: ({commit}) => {
  //things
},

I want to be able to call one action from within another, so in this example I want to be able to call get2() from within get1() .我希望能够从另一个内部调用一个操作,因此在本示例中,我希望能够从get2()内部调用get2() get1() Is this possible, and if so, how can I do it?这可能吗,如果可以,我该怎么做?


解决方案:

参考一: https://en.stackoom.com/question/36NPa
参考二: https://stackoom.com/question/36NPa
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章