1.
filters的数据是数组,把获取相应的数组使用map方法,将数据转换为text:,value:,
再将onFilter:(value,record) => {
return record. = value
}
例子:
store:
let type = [];
for (var key in x.data.category) {
if (x.data.category.hasOwnProperty(key)) {
type.push({
name: x.data.category[key].name,
id: key
})
}
}
this.skuType = type.map(x => ({ text:x.name, value:x.id }));
{
title: '分类',
dataIndex: 'catename',
key: '分类',
filters: toJS(this.props.sku.skuType) || [],
onFilter: (value, record) => {
return record.cateid === value},
}