Merge pull request #605 from hezhiying/table-filters
添加filterRemote方法,支持用户远程筛选数据
This commit is contained in:
commit
91bda66d87
2 changed files with 47 additions and 1 deletions
|
@ -16,7 +16,28 @@
|
|||
},
|
||||
{
|
||||
title: '年龄',
|
||||
key: 'age'
|
||||
key: 'age',
|
||||
filters:[
|
||||
{
|
||||
label: '小学',
|
||||
value: '小学'
|
||||
},
|
||||
{
|
||||
label: '中学',
|
||||
value: '大学'
|
||||
},
|
||||
{
|
||||
label: '中学',
|
||||
value: '中学'
|
||||
}
|
||||
],
|
||||
filterRemote:function(value,key,column){
|
||||
var that = this;
|
||||
this.$Notice.open({title:`正在远程过滤${key}`,desc:value,duration:3,onClose:function(){
|
||||
that.remoteFilter(value,key,column)
|
||||
}})
|
||||
|
||||
}
|
||||
},
|
||||
{
|
||||
title: '地址',
|
||||
|
@ -66,6 +87,23 @@
|
|||
}
|
||||
]
|
||||
}
|
||||
|
||||
},
|
||||
methods:{
|
||||
remoteFilter:function(val,age,column){
|
||||
this.data1 = [
|
||||
{
|
||||
name: '模拟1',
|
||||
age: 18,
|
||||
address: '北京市朝阳区芍药居'
|
||||
},
|
||||
{
|
||||
name: '模拟2',
|
||||
age: 25,
|
||||
address: '北京市海淀区西二旗'
|
||||
},
|
||||
]
|
||||
}
|
||||
}
|
||||
}
|
||||
</script>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue