Propagate type changes to panel

This commit is contained in:
Sergio Crisostomo 2017-09-14 07:57:01 +02:00
parent ccb6a76d90
commit 9ffdd6daea
2 changed files with 55 additions and 1 deletions

View file

@ -23,6 +23,17 @@ export default {
},
value: {}
},
watch: {
type(value){
const typeMap = {
year: 'year',
month: 'month',
date: 'day'
};
const validType = oneOf(value, Object.keys(typeMap));
if (validType) this.Panel.selectionMode = typeMap[value];
}
},
created () {
if (!this.currentValue) {
if (this.type === 'daterange' || this.type === 'datetimerange') {