My method in vue looks like this :
(我在vue中的方法如下所示:)
methods: {
setDate: async function () {
console.log(this.modal)
}
}
I want to change it to an arrow function.
(我想将其更改为箭头功能。)
I tried like this : (我这样尝试过:)
methods: {
setDate: async () => {
console.log(this.modal)
}
}
There exist error like this :
(存在这样的错误:)
Cannot read property 'modal' of undefined
How can I solve this problem?
(我怎么解决这个问题?)
ask by positive thinking translate from so 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…