Computed property resource selection

This commit is contained in:
2022-09-28 01:28:11 -04:00
parent 93994d5dd7
commit 4477f4b5c7
2 changed files with 11 additions and 10 deletions

View File

@@ -37,16 +37,15 @@
client: Object
},
data() {
var resources = state.resources;
return {
selection: resources ? (resources.split(',').filter(x => x) || []) : [],
date: dateonly(new Date()),
date_end: dateonly(new Date())
};
},
watch: {
selection(value, oldvalue) {
state.resources = value.join(',');
computed: {
selection: {
get() { return state.resources ? (state.resources.split(',').filter(x => x) || []) : [] },
set(value) { state.resources = value.join(','); }
}
}
};