javascript - 如何在 vue js 2.5.16 上进行搜索过滤?
问题描述
我的 vue 项目中需要一个搜索过滤器。我试图创建“文本中的文本 | filterBy filtername”,但这不适用于最新版本的 vue js。请帮忙!
解决方案
您不能以这种方式使用过滤器,您可以以这种方式使用过滤器:在html中:{{ prop | 筛选}}
在js中:this.$options.filters.yourFilter(this.prop);
在html 道具中::text="this.$options.yourFilter(prop);"
推荐阅读
- css - 域名更改后 WordPress 网站坏了。(CSS)
- php - 刷新数据表而不重新加载页面
- react-native - GeoFire 与本机反应
- amazon-web-services - 在 EC2 Ubuntu VM 上运行一行部署脚本时生成的 URL 不起作用
- css - 如何将菜单栏的prime ng子菜单向右对齐?
- xcode12 - 升级到 Xcode 12:ld 后的问题:为 iOS 模拟器构建,但在为 iOS 构建的 dylib 中链接,架构 arm64
- c# - 表单上的 timeout 属性不起作用,几分钟后过期
- angular - 如何动态创建控件?
- php - 未定义的索引 - Apache - 环境变量
- python - 如何设置一些特定于我的代理的属性,以防止原始对象获取它