i'm quite a beginner so this i probably obvious to you guys but... I'm making a filter in Vue js 2.0 that filter in any column. I came up with this
computed: {
filteredAndSortedData() {
let result = this.testData;
if (this.filterValue) {
result = result.filter(item =>
item.round.includes(this.filterValue) ||
item.cat.includes(this.filterValue) ||
item.player1.includes(this.filterValue) ||
item.player2.includes(this.filterValue));
}
here the jsfiddle example: https://jsfiddle.net/ebxsvac0/ of what i'm trying to do.
My question is how do I rewrite this code without hardcoding the column variable. thank