[Vuejs]-Array filter in VueJS

0👍

If I understand your question correctly, you want to select all results that have one or more tags in common with the current tags?

Instead of changing the active flag on your results, why not filter the results based on your criteria?

this.activeResults = this.results.filter( function(result) {
    return result.tags.some(function(tag) {
        return tag.indexOf(activeTags) != -1;
    });
});

Then just render activeResults instead of results.

Leave a comment