大家好,又见面了,我是你们的朋友全栈君。
需求:vue中,除了在模板中使用过滤器,有时候,methods中也需要使用filters中的过滤器!
this.$options.filters[filter](…args) //这种方法很简单,也很实用
打印 this.$options.filters报错, 打印this.$options.filters.myFilter正常,显示为一个function
原文地址:https://blog.csdn.net/huipo22/article/details/78252600
发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/144875.html原文链接:https://javaforall.net