是
Table 表格
关于table表头过滤所需要的filters是否可以默认从数据中自动获取到?不然如果我一个表格有很多列需要进行表头过滤的时候,我需要写很多的filters,是否可以默认
hts6caw31#
同问
sqserrrh2#
+1
vjrehmav3#
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
ie3xauqp4#
i like thisgetFilter(item) {const key = item.name;const filterData = [];this.tableData.forEach((item) => {if (filterData.every((f) => f.text != item[key])) {filterData.push({ text: item[key], value: item[key] });}});return filterData;}
:filters="getFilter(item)"
4条答案
按热度按时间hts6caw31#
同问
sqserrrh2#
+1
vjrehmav3#
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.
ie3xauqp4#
i like this
getFilter(item) {
const key = item.name;
const filterData = [];
this.tableData.forEach((item) => {
if (filterData.every((f) => f.text != item[key])) {
filterData.push({ text: item[key], value: item[key] });
}
});
return filterData;
}
:filters="getFilter(item)"