Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- formattedItems: {
- get() {
- let items = [];
- this.items.map(mapItem => mapItem.categories = this.optionsCategories);
- this.items.forEach((item, index, array) => {
- array.forEach(el => {
- if(el.id === item.id && el.category !== item.category) {
- el.categories = el.categories.filter(category => category !== item.category);
- }
- });
- items = [...array];
- });
- return items;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement