DatePicker: dynamic picker-options, close #2013 (#2051)

pull/2058/head
cinwell.li 2016-12-29 10:43:51 +08:00 committed by FuryBean
parent bdd0604bd0
commit eefa3fec78
1 changed files with 25 additions and 21 deletions

View File

@ -408,6 +408,7 @@ export default {
this.picker.format = this.format;
}
const updateOptions = () => {
const options = this.pickerOptions;
if (options && options.selectableRange) {
@ -432,6 +433,9 @@ export default {
this.picker[option] = options[option];
}
}
};
updateOptions();
this.$watch('pickerOptions', () => updateOptions(), { deep: true });
this.$el.appendChild(this.picker.$el);
this.pickerVisible = this.picker.visible = true;