- vue版本:2.5.1
代码:
filters: {
nameHighLight (item) {
console.log('_____+++++++', this);
}
}
结果是:
难道在filters是无法获取this
的?
代码:
filters: {
nameHighLight (item) {
console.log('_____+++++++', this);
}
}
结果是:
难道在filters是无法获取this
的?
console.log
的表现行为是异步的,
所以需要这样
filters: {
nameHighLight (item) {
var _this = this;
console.log('_____+++++++', _this);
}
}
mark一下,自己的错误
https://github.com/vuejs/vue/...
10 回答11.1k 阅读
6 回答3k 阅读
5 回答4.8k 阅读✓ 已解决
4 回答3.1k 阅读✓ 已解决
2 回答2.7k 阅读✓ 已解决
2 回答4.7k 阅读✓ 已解决
4 回答4.3k 阅读✓ 已解决
尤大亲自回答:
https://github.com/vuejs/vue/...