I think, I've figured it myself but not sure if this is the proper way of doing this.
computed: {
checkedResources: {
get: function () {
let items = this.checklist.filter(item => item.selected === true)
return Object.keys(items).map(function (key) { return items[key].name; });
},
set: function(listItems) {
console.log(listItems);
this.checklist.map(function(item) {
item.selected = listItems.includes(item.name)?true:false;
return item;
})
}
}
}
Please correct me if I'm doing anything unusual.
Thank you