問題:
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