假设我有一组通过道具可用的类别名称。
在vue-tables-2中,如何category
在选项中动态填充过滤器listColumns
?
listColumns: {
type: [{
id: 1,
text: 'User'
},
{
id: 2,
text: 'Admin'
}],
category: function () {
this.categories.map((cat, index) => { return { id: index, text: cat } })
}
}
这样做会返回以下错误:
[Vue warn]: Error in render: "TypeError: _this.opts.listColumns[column].filter is not a function"