0
A good straight-forward answer can be given if you say the intention behind that structuring otherwise you could just use a method to accomplish that.
{
data() {
return {
productsByCategory: [],
productsByTag: [],
filteredProducts: []
};
},
methods: {
groupProducts() {
this.filteredProducts.push({
type: "Category",
products: this.productsByCategory
});
this.filteredProducts.push({
type: "Tag",
products: this.productsByTag
});
}
}
}
Source:stackexchange.com