DatePicker add clearable prop

DatePicker add clearable prop
This commit is contained in:
梁灏 2016-12-20 10:31:28 +08:00
parent d31b0d4790
commit fe44201b46
2 changed files with 6 additions and 1 deletions

View file

@ -158,6 +158,10 @@
type: Boolean, type: Boolean,
default: true default: true
}, },
clearable: {
type: Boolean,
default: true
},
size: { size: {
validator (value) { validator (value) {
return oneOf(value, ['small', 'large']); return oneOf(value, ['small', 'large']);
@ -302,7 +306,7 @@
}, },
handleInputMouseenter () { handleInputMouseenter () {
if (this.readonly || this.disabled) return; if (this.readonly || this.disabled) return;
if (this.visualValue) { if (this.visualValue && this.clearable) {
this.showClose = true; this.showClose = true;
} }
}, },

View file

@ -24,6 +24,7 @@
:editable="true" :editable="true"
:format="format" :format="format"
@on-change="change" @on-change="change"
:clearable="false"
:options="options2"></date-picker> :options="options2"></date-picker>
</i-col> </i-col>
</row> </row>