Computed property resource selection
This commit is contained in:
@@ -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(','); }
|
||||
}
|
||||
}
|
||||
};
|
||||
|
Reference in New Issue
Block a user