如图 调用接口的时候报错了,不知道什么原因
代码:
watch: {
'visible': {
handler: function (newVal, oldVal) {
console.log(newVal)
if (newVal) {
console.log(this.actionId)
if (this.actionId && this.actionId !== '') {
getActionById(this.actionId).then(res => {
const _data = res.data
console.log(_data)
_data.actionKey = String(_data.actionKey)
_data.actionName = String(_data.actionName)
_data.isCategory = String(_data.isCategory)
this.actionInfo = _data
})
} else {
this.actionInfo = {
actionKey: '',
actionName: '',
isCategory: ''
}
}
}
}
}
},
可以检查下
getActionById
这个方法的定义,控制台提示的是他不是一个函数类型