element
element copied to clipboard
[select] filter-method 该怎么写,官网也没有样例
我目前是这么写的
filterMaterials (input) {
return this.materialsSource.filter(function (item,index) {
console.log(((index+1)+'').indexOf(input+''))
if (((index+1)+'').indexOf(input+'') >= 0) {
return true
} else {
return false
}
})
}
想通过输入1,2,3这样选中列表中的项,但是这样过滤虽然被调用了,但是不起作用啊
filter-method 做的是过滤选项列表,并不能通过它来「选中列表中的项」。
关于怎么写 filter-method,可以参考 #591。
@Leopoldthecoder 十分感谢,希望可以补充下官网的文档比较好