From fe44201b46fd4d25007152ac884926a0ec64ae84 Mon Sep 17 00:00:00 2001 From: 梁灏 Date: Tue, 20 Dec 2016 10:31:28 +0800 Subject: [PATCH] DatePicker add clearable prop --- src/components/date-picker/picker.vue | 6 +++++- test/routers/date.vue | 1 + 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/src/components/date-picker/picker.vue b/src/components/date-picker/picker.vue index 61b29e9..7768aab 100644 --- a/src/components/date-picker/picker.vue +++ b/src/components/date-picker/picker.vue @@ -158,6 +158,10 @@ type: Boolean, default: true }, + clearable: { + type: Boolean, + default: true + }, size: { validator (value) { return oneOf(value, ['small', 'large']); @@ -302,7 +306,7 @@ }, handleInputMouseenter () { if (this.readonly || this.disabled) return; - if (this.visualValue) { + if (this.visualValue && this.clearable) { this.showClose = true; } }, diff --git a/test/routers/date.vue b/test/routers/date.vue index 80552b7..53d1195 100644 --- a/test/routers/date.vue +++ b/test/routers/date.vue @@ -24,6 +24,7 @@ :editable="true" :format="format" @on-change="change" + :clearable="false" :options="options2"> -- libgit2 0.21.4