首页 > 解决方案 > 如何在 vue js 2.5.16 上进行搜索过滤?

问题描述

我的 vue 项目中需要一个搜索过滤器。我试图创建“文本中的文本 | filterBy filtername”,但这不适用于最新版本的 vue js。请帮忙!

标签: javascriptsearchvue.jsfilter

解决方案


不能以这种方式使用过滤器,您可以以这种方式使用过滤器:在html中:{{ prop | 筛选}}

js中:this.$options.filters.yourFilter(this.prop);

html 道具中::text="this.$options.yourFilter(prop);"


推荐阅读