Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
250 views
in Technique[技术] by (71.8m points)

vue js调用报错

如图 调用接口的时候报错了,不知道什么原因
image.png
代码:

 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: ''
                    }
                }
            }
        }
    }
  },

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

可以检查下getActionById这个方法的定义,控制台提示的是他不是一个函数类型


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to WuJiGu Developer Q&A Community for programmer and developer-Open, Learning and Share
...