Vue中,methods中调用filters里的过滤器

需求:vue中,除了在模板中使用过滤器,有时候,methods中也需要使用filters中的过滤器!

this.$options.filters[filter](...args) //这种方法很简单,也很实用

打印 this.$options.filters报错, 打印this.$options.filters.myFilter正常,显示为一个function

原文地址:https://blog.csdn.net/huipo22/article/details/78252600

猜你喜欢

转载自blog.csdn.net/Jerryman_GHJ/article/details/81738687
今日推荐