<template>
<div>{{price | formatPri(that)}}</div>
</template>
<script>
export default {
name: "test",
data() {
return {
that: this,
pre: '¥'
}
},
filters: {
formatPri(val, that) {
console.log(that);
return that.pre+val.toFixed(2)
}
}
}
</script>
vue过滤器filters获取不到this实例化对象的解决办法
最新推荐文章于 2024-09-03 21:44:01 发布