2
0
mirror of https://github.com/tenrok/vue2-datepicker.git synced 2026-06-23 23:40:36 +03:00

feat: add slot input

This commit is contained in:
mengxiong10
2019-11-14 16:32:29 +08:00
parent 51f3313865
commit ffd3918536
+16 -14
View File
@@ -8,20 +8,22 @@
}" }"
> >
<div v-if="!inline" class="mx-input-wrapper" @mousedown="openPopup" @touchstart="openPopup"> <div v-if="!inline" class="mx-input-wrapper" @mousedown="openPopup" @touchstart="openPopup">
<input <slot name="input">
ref="input" <input
v-bind="{ name: 'date', type: 'text', autocomplete: 'off', ...inputAttr }" ref="input"
:class="inputClass" v-bind="{ name: 'date', type: 'text', autocomplete: 'off', ...inputAttr }"
:disabled="disabled" :class="inputClass"
:readonly="!editable" :disabled="disabled"
:value="text" :readonly="!editable"
:placeholder="placeholder" :value="text"
@keydown="handleInputKeydown" :placeholder="placeholder"
@focus="handleInputFocus" @keydown="handleInputKeydown"
@blur="handleInputBlur" @focus="handleInputFocus"
@input="handleInputInput" @blur="handleInputBlur"
@change="handleInputChange" @input="handleInputInput"
/> @change="handleInputChange"
/>
</slot>
<i v-if="showClearIcon" class="mx-icon-clear" @mousedown.stop="handleClear"> <i v-if="showClearIcon" class="mx-icon-clear" @mousedown.stop="handleClear">
<slot name="icon-clear"> <slot name="icon-clear">
<icon-close></icon-close> <icon-close></icon-close>