Commit fe44201b46fd4d25007152ac884926a0ec64ae84

Authored by 梁灏
1 parent d31b0d47

DatePicker add clearable prop

DatePicker add clearable prop
src/components/date-picker/picker.vue
... ... @@ -158,6 +158,10 @@
158 158 type: Boolean,
159 159 default: true
160 160 },
  161 + clearable: {
  162 + type: Boolean,
  163 + default: true
  164 + },
161 165 size: {
162 166 validator (value) {
163 167 return oneOf(value, ['small', 'large']);
... ... @@ -302,7 +306,7 @@
302 306 },
303 307 handleInputMouseenter () {
304 308 if (this.readonly || this.disabled) return;
305   - if (this.visualValue) {
  309 + if (this.visualValue && this.clearable) {
306 310 this.showClose = true;
307 311 }
308 312 },
... ...
test/routers/date.vue
... ... @@ -24,6 +24,7 @@
24 24 :editable="true"
25 25 :format="format"
26 26 @on-change="change"
  27 + :clearable="false"
27 28 :options="options2"></date-picker>
28 29 </i-col>
29 30 </row>
... ...