diff --git a/README.md b/README.md index 28a38db..17c0b4e 100644 --- a/README.md +++ b/README.md @@ -66,6 +66,7 @@ export default { | first-day-of-week | Number | 7 | set the first day of week (1-7) | | input-class | String | 'mx-input' | the input class name | | confirm-text | String | 'OK' | the default text to display on confirm button | +| disabled | Boolean | false | Disable the component | #### shortcuts * true - show the default shortcuts diff --git a/README_CN.md b/README_CN.md index b3f84fd..8c729ed 100644 --- a/README_CN.md +++ b/README_CN.md @@ -65,7 +65,8 @@ export default { | minute-step | Number | 0 | 分钟的步进,设置time-picker-options,这项无效 | first-day-of-week | Number | 7 | 设置日历星期几开头(1-7) | input-class | String | 'mx-input' | 自定义输入框的类名 -| confirm-text | String | 'OK' | 确认按钮的名称 +| confirm-text | String | 'OK' | 确认按钮的名称 +| disabled | Boolean | false | 禁用组件 #### shortcuts * true - 显示默认快捷选择 diff --git a/datepicker/calendar-panel.vue b/datepicker/calendar-panel.vue index ec2279c..51749a2 100644 --- a/datepicker/calendar-panel.vue +++ b/datepicker/calendar-panel.vue @@ -432,12 +432,20 @@ export default { const now = new Date(this.now) now.setFullYear(year) this.now = now + if (this.value) { + this.$emit('input', now) + this.$emit('select', true) + } this.currentPanel = 'months' }, selectMonth(month) { const now = new Date(this.now) now.setMonth(month) this.now = now + if (this.value) { + this.$emit('input', now) + this.$emit('select', true) + } this.currentPanel = 'date' }, selectTime(value, index) { diff --git a/datepicker/index.vue b/datepicker/index.vue index 6ad7ec0..d070c79 100644 --- a/datepicker/index.vue +++ b/datepicker/index.vue @@ -1,12 +1,17 @@