function checkeddata(value) {
console.log(value)
const name = value.label
return name.indexOf(val) !== -1
}
console.log(this.state.poDatas)
var showfilterList = this.state.poDatas.filter(checkeddata)
console.log(‘过滤后:’)
console.log(showfilterList)
this.setState({
showfilterList: […showfilterList],
isfilter:true
})
【react——小技巧】过滤搜索filter
最新推荐文章于 2024-05-28 09:52:35 发布