From 11fb50229f2a8dbc7697581b1863dd20924c0bed Mon Sep 17 00:00:00 2001 From: mxie <15623530290@163.com> Date: Sat, 10 Feb 2018 18:48:27 +0800 Subject: [PATCH] =?UTF-8?q?=E6=B7=BB=E5=8A=A0disabled=E5=B1=9E=E6=80=A7?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 1 + README_CN.md | 3 +- datepicker/calendar-panel.vue | 8 +++++ datepicker/index.vue | 32 +++++++++++++++++-- dist/build.js | 2 +- package.json | 2 +- ...uild.config.js => webpack.deploy.config.js | 0 7 files changed, 42 insertions(+), 6 deletions(-) rename webpack.build.config.js => webpack.deploy.config.js (100%) 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 @@