vue过滤器filters获取不到this对象的解决办法
<template><div>{{a|sum(that)}}</div>
</template>
<script>
export default {
name: "test",
data() {
return {
that: this,
a: 1,
b: 2
}
},
filters: {
sum(a, that) {
console.log(that);
return a + that.b;
}
},
}
以上是 vue过滤器filters获取不到this对象的解决办法 的全部内容, 来源链接: utcz.com/z/377223.html