Imagine you have an array of category names passed as a prop.
When using vue-tables-2, how can you dynamically populate a category
filter in the listColumns
option?
listColumns: {
type: [{
id: 1,
text: 'User'
},
{
id: 2,
text: 'Admin'
}],
category: function () {
this.categories.map((cat, index) => { return { id: index, text: cat } })
}
}
However, when attempting to do this as shown above, it results in the following error message:
[Vue warn]: Error in render: "TypeError: _this.opts.listColumns[column].filter is not a function"