update DatePicker

update DatePicker
This commit is contained in:
梁灏 2016-12-19 21:09:57 +08:00
parent fa3a666da1
commit 0a5c5f4132
5 changed files with 138 additions and 43 deletions

View file

@ -14,17 +14,8 @@ export default {
if (shortcut.value) this.$emit('on-pick', shortcut.value());
if (shortcut.onClick) shortcut.onClick(this);
},
resetView() {
if (this.selectionMode === 'month') {
this.currentView = 'month';
} else if (this.selectionMode === 'year') {
this.currentView = 'year';
} else {
this.currentView = 'date';
}
this.year = this.date.getFullYear();
this.month = this.date.getMonth();
resetDate () {
this.date = new Date(this.date);
}
}
}