我正在尝试像这样访问过滤器函数中的 vue 实例数据。JS:-
new Vue({
 data:{
  amount: 10,
  exchangeRate:50
 },
 el:"#app",
 filters:{
   currency: function(amount){
             console.log(this);
             //return amount * this.exchangeRate;
            return amount *50;
   }
 }
})
HTML:
<div id="app">
 {{ amount | currency}}
</div>
我的目标是使用return amount * this.exchangeRate;但this等于window这里。我怎样才能做到这一点 ?谢谢。
提琴手