從另一個動作中調用一個動作 - 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
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章