假设我有一个方法
const actions = {
async fetchByQuery({
commit
}, title) {
const response = await..........code goes here
}
}
我想在这样的方法中使用我自己的另一个函数:
const actions = {
async fetchByQuery({
commit
}, title) {
const response = await..........code goes here
this.helperfunction();
}
helperfunction(){
......code goes here
}
}
我该如何使用辅助功能?
我尝试了上述方法并得到错误this.helperfunction is not a function