watch: {
allCards(newValue) {
console.log(this.allCards)
if (this.allCards===true) {
this.items.forEach((item) => {
this.itemsSelected.push({
title: item.id
})
})
console.log(this.itemsSelected)
} else if (this.allCards===false) {
this.itemsSelected = []
console.log(this.itemsSelected)
}
}
},
itemsSelected: [ 1,2,3,4 ]
. this.itemsSelected.push(item.id);
this.itemsSelected.push(parseInt(item.id, 10));