forked from verdnatura/salix-front
refs #6907 feat: merge changes
This commit is contained in:
parent
f5d6c45339
commit
18d4be0ea2
|
@ -26,7 +26,7 @@ const value = computed({
|
||||||
emit('update:modelValue', value);
|
emit('update:modelValue', value);
|
||||||
},
|
},
|
||||||
});
|
});
|
||||||
const focus = ref(false);
|
const hover = ref(false);
|
||||||
const styleAttrs = computed(() => {
|
const styleAttrs = computed(() => {
|
||||||
return $props.isOutlined
|
return $props.isOutlined
|
||||||
? {
|
? {
|
||||||
|
@ -45,6 +45,10 @@ const handleValue = (val = null) => {
|
||||||
value.value = val;
|
value.value = val;
|
||||||
};
|
};
|
||||||
|
|
||||||
|
const focus = () => {
|
||||||
|
vnInputRef.value.focus();
|
||||||
|
};
|
||||||
|
|
||||||
defineExpose({
|
defineExpose({
|
||||||
focus,
|
focus,
|
||||||
});
|
});
|
||||||
|
@ -52,8 +56,8 @@ defineExpose({
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
<div
|
<div
|
||||||
@mouseover="focus = true"
|
@mouseover="hover = true"
|
||||||
@mouseleave="focus = false"
|
@mouseleave="hover = false"
|
||||||
:rules="$attrs.required ? [requiredFieldRule] : null"
|
:rules="$attrs.required ? [requiredFieldRule] : null"
|
||||||
>
|
>
|
||||||
<QInput
|
<QInput
|
||||||
|
@ -74,7 +78,7 @@ defineExpose({
|
||||||
<QIcon
|
<QIcon
|
||||||
name="close"
|
name="close"
|
||||||
size="xs"
|
size="xs"
|
||||||
v-if="focus && value"
|
v-if="hover && value"
|
||||||
@click="handleValue(null)"
|
@click="handleValue(null)"
|
||||||
></QIcon>
|
></QIcon>
|
||||||
</template>
|
</template>
|
||||||
|
|
Loading…
Reference in New Issue