|
|
@@ -44,6 +44,7 @@ export default { |
|
|
|
'name', 'readonly', 'value', 'label', 'placeholder', 'required', 'rules', 'labelWidth', |
|
|
|
'type', // 类型, 仅支持 datetime date time year-month month-day datehour |
|
|
|
'formatter', // value的格式化 String|Function|undefined 字符串为格式字符串, 函数则必须有返回 undefined则不转换 |
|
|
|
'clearable', // 点击取消时清空绑定值 |
|
|
|
], |
|
|
|
watch: { |
|
|
|
value: function (newVal, oldVal) { |
|
|
@@ -108,6 +109,12 @@ export default { |
|
|
|
onCancel() { |
|
|
|
this.closePopup(); |
|
|
|
this.$emit('cancel'); |
|
|
|
if(this.clearable) |
|
|
|
{ |
|
|
|
this.visibleValue = ''; |
|
|
|
this.internalValue = null; |
|
|
|
this.$emit('input', this.internalValue); |
|
|
|
} |
|
|
|
}, |
|
|
|
onChanged(data) { |
|
|
|
this.$emit('change', this.getValue(data), data); |
|
|
|