vuejs / Discussion

Vue.js discussion
167 stars 17 forks source link

how to set dynamic filter by vuejs #1293

Closed fqdeng closed 6 years ago

fqdeng commented 7 years ago

so , I have a filter value like this

data:{ age: //it's a value bind by html input element person:[ {name:'dick',age:30},//and more ] }

and I want to filer person age > age (value by user input) dynamic so , how to implament

thanks

fqdeng commented 7 years ago

用中文再写一遍,英语太烂了

就是我想要一个动态过滤器,过滤的条件值是通过 控件input绑定的值,vuejs有没有简易的实现,

我之前用的是 clone两个数组,根据监控过滤值来决定是否显示值

cmp-cc commented 7 years ago

双向数据绑定,应当基于数据驱动开发。 示例:

https://jsfiddle.net/cmpcc/e8bjfuk0/

fqdeng commented 7 years ago

@cmp-cc thanks 已经解决了这个问题,确实是要按照computed 来进行开发

fqdeng commented 7 years ago

@cmp-cc thanks 已经解决了这个问题,确实是要按照computed 来进行开发