From 68e9b1003beb19b3c9f6c2f34af6d343c8aaace0 Mon Sep 17 00:00:00 2001 From: 梁灏 Date: Thu, 22 Dec 2016 09:18:11 +0800 Subject: [PATCH] update DatePicker --- package.json | 2 +- src/components/date-picker/base/date-table.vue | 1 + src/components/date-picker/base/month-table.vue | 1 + src/components/date-picker/base/year-table.vue | 1 + src/components/date-picker/panel/date-range.vue | 18 ++++++++++++------ src/components/date-picker/panel/date.vue | 9 ++++++--- src/components/date-picker/panel/mixin.js | 3 +++ src/components/date-picker/picker.vue | 25 +++++++++++++++++-------- test/routers/date.vue | 44 ++++++++++++-------------------------------- test/routers/dropdown.vue | 30 +++++++++++++----------------- 10 files changed, 67 insertions(+), 67 deletions(-) diff --git a/package.json b/package.json index 5deb702..1b11d42 100644 --- a/package.json +++ b/package.json @@ -1,6 +1,6 @@ { "name": "iview", - "version": "0.9.11-rc-3", + "version": "0.9.11-rc-4", "title": "iView", "description": "A high quality UI components Library with Vue.js", "homepage": "http://www.iviewui.com", diff --git a/src/components/date-picker/base/date-table.vue b/src/components/date-picker/base/date-table.vue index f4509d6..db75489 100644 --- a/src/components/date-picker/base/date-table.vue +++ b/src/components/date-picker/base/date-table.vue @@ -224,6 +224,7 @@ this.$emit('on-pick', newDate); } } + this.$emit('on-pick-click'); }, handleMouseMove (event) { if (!this.rangeState.selecting) return; diff --git a/src/components/date-picker/base/month-table.vue b/src/components/date-picker/base/month-table.vue index 78f51ed..e822630 100644 --- a/src/components/date-picker/base/month-table.vue +++ b/src/components/date-picker/base/month-table.vue @@ -67,6 +67,7 @@ this.$emit('on-pick', index); } + this.$emit('on-pick-click'); } } } diff --git a/src/components/date-picker/base/year-table.vue b/src/components/date-picker/base/year-table.vue index 1934372..f3d3403 100644 --- a/src/components/date-picker/base/year-table.vue +++ b/src/components/date-picker/base/year-table.vue @@ -73,6 +73,7 @@ this.$emit('on-pick', cell.text); } + this.$emit('on-pick-click'); } } } diff --git a/src/components/date-picker/panel/date-range.vue b/src/components/date-picker/panel/date-range.vue index a8d9713..04c2dff 100644 --- a/src/components/date-picker/panel/date-range.vue +++ b/src/components/date-picker/panel/date-range.vue @@ -39,7 +39,8 @@ selection-mode="range" :disabled-date="disabledDate" @on-changerange="handleChangeRange" - @on-pick="handleRangePick"> + @on-pick="handleRangePick" + @on-pick-click="handlePickClick"> + @on-pick="handleLeftYearPick" + @on-pick-click="handlePickClick"> + @on-pick="handleLeftMonthPick" + @on-pick-click="handlePickClick">
@@ -89,7 +92,8 @@ selection-mode="range" :disabled-date="disabledDate" @on-changerange="handleChangeRange" - @on-pick="handleRangePick"> + @on-pick="handleRangePick" + @on-pick-click="handlePickClick"> + @on-pick="handleRightYearPick" + @on-pick-click="handlePickClick"> + @on-pick="handleRightMonthPick" + @on-pick-click="handlePickClick">
+ @on-pick="handleDatePick" + @on-pick-click="handlePickClick"> + @on-pick="handleYearPick" + @on-pick-click="handlePickClick"> + @on-pick="handleMonthPick" + @on-pick-click="handlePickClick">
this.disableClickOutSide = true); // todo $on('on-time-range') } diff --git a/test/routers/date.vue b/test/routers/date.vue index bf4ba19..0cb5507 100644 --- a/test/routers/date.vue +++ b/test/routers/date.vue @@ -1,36 +1,16 @@