【发布时间】:2021-01-19 00:18:17
【问题描述】:
有什么解决方案可以在方法上使用 lodash debounce 吗?我还需要函数中的“this”。 示例:
data() {
info: 'Read Me!'
},
methods: {
readData() {
console.log(this.info)
}
}
在 Vue2 中我可以使用:
methods: {
readData: debounce(function() {
console.log(this.info)
}, 500)
}
【问题讨论】:
标签: javascript vue.js vue-component vuejs3