0๐
I think this is a use case of computed properties [https://v2.vuejs.org/v2/guide/computed.html]
May be something like this:
computed: {
filterItems: function() {
return this.allitems.filter(item => item.type != singleitem.type);
}
}
So whenever the data changed. filterItems get (re)computed.
- [Vuejs]-How do I populate auto generated input fields with Vue / Laravel
- [Vuejs]-Adding an IF Statement to a Filter Method in Vue
Source:stackexchange.com