forked from verdnatura/salix-front
Reviewed-on: verdnatura/salix-front#379 Reviewed-by: Javier Segarra <jsegarra@verdnatura.es>
This commit is contained in:
commit
475f0eda48
|
@ -37,14 +37,6 @@ const styleAttrs = computed(() => {
|
||||||
: {};
|
: {};
|
||||||
});
|
});
|
||||||
|
|
||||||
const onEnterPress = () => {
|
|
||||||
emit('keyup.enter');
|
|
||||||
};
|
|
||||||
|
|
||||||
const handleValue = (val = null) => {
|
|
||||||
value.value = val;
|
|
||||||
};
|
|
||||||
|
|
||||||
const focus = () => {
|
const focus = () => {
|
||||||
vnInputRef.value.focus();
|
vnInputRef.value.focus();
|
||||||
};
|
};
|
||||||
|
@ -73,7 +65,7 @@ const inputRules = [
|
||||||
v-bind="{ ...$attrs, ...styleAttrs }"
|
v-bind="{ ...$attrs, ...styleAttrs }"
|
||||||
:type="$attrs.type"
|
:type="$attrs.type"
|
||||||
:class="{ required: $attrs.required }"
|
:class="{ required: $attrs.required }"
|
||||||
@keyup.enter="onEnterPress()"
|
@keyup.enter="emit('keyup.enter')"
|
||||||
:clearable="false"
|
:clearable="false"
|
||||||
:rules="inputRules"
|
:rules="inputRules"
|
||||||
:lazy-rules="true"
|
:lazy-rules="true"
|
||||||
|
@ -83,13 +75,13 @@ const inputRules = [
|
||||||
<slot name="prepend" />
|
<slot name="prepend" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template #append v-if="!!$attrs.disabled">
|
<template #append>
|
||||||
<slot name="append" v-if="$slots.append" />
|
<slot name="append" v-if="$slots.append && !$attrs.disabled" />
|
||||||
<QIcon
|
<QIcon
|
||||||
name="close"
|
name="close"
|
||||||
size="xs"
|
size="xs"
|
||||||
v-if="hover && value"
|
v-if="$slots.append && hover && value && !$attrs.disabled"
|
||||||
@click="handleValue(null)"
|
@click="value = null"
|
||||||
></QIcon>
|
></QIcon>
|
||||||
</template>
|
</template>
|
||||||
</QInput>
|
</QInput>
|
||||||
|
|
Loading…
Reference in New Issue