Update MkInput.vue

This commit is contained in:
syuilo 2023-05-02 09:22:37 +09:00
parent f5e9886c70
commit 4495969d7f

View file

@ -2,7 +2,7 @@
<div> <div>
<div :class="$style.label" @click="focus"><slot name="label"></slot></div> <div :class="$style.label" @click="focus"><slot name="label"></slot></div>
<div :class="[$style.input, { inline, disabled, focused }]"> <div :class="[$style.input, { inline, disabled, focused }]">
<div ref="prefixEl" :class="$style.prefix"><div :class="$style.prefixOrSuffixText"><slot name="prefix"></slot></div></div> <div ref="prefixEl" :class="$style.prefix"><slot name="prefix"></slot></div>
<input <input
ref="inputEl" ref="inputEl"
v-model="v" v-model="v"
@ -26,7 +26,7 @@
<datalist v-if="datalist" :id="id"> <datalist v-if="datalist" :id="id">
<option v-for="data in datalist" :key="data" :value="data"/> <option v-for="data in datalist" :key="data" :value="data"/>
</datalist> </datalist>
<div ref="suffixEl" :class="$style.suffix"><div :class="$style.prefixOrSuffixText"><slot name="suffix"></slot></div></div> <div ref="suffixEl" :class="$style.suffix"><slot name="suffix"></slot></div>
</div> </div>
<div :class="$style.caption"><slot name="caption"></slot></div> <div :class="$style.caption"><slot name="caption"></slot></div>
@ -233,6 +233,12 @@ onMounted(() => {
padding: 0 12px; padding: 0 12px;
font-size: 1em; font-size: 1em;
height: v-bind("height + 'px'"); height: v-bind("height + 'px'");
min-width: 16px;
max-width: 150px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
box-sizing: border-box;
pointer-events: none; pointer-events: none;
&:empty { &:empty {
@ -249,16 +255,6 @@ onMounted(() => {
right: 0; right: 0;
padding-left: 6px; padding-left: 6px;
} }
.prefixOrSuffixText {
display: inline-block;
min-width: 16px;
max-width: 150px;
overflow: hidden;
white-space: nowrap;
text-overflow: ellipsis;
}
.save { .save {
margin: 8px 0 0 0; margin: 8px 0 0 0;
} }