0
0
Fork 0

refs #6907 feat: merge changes

This commit is contained in:
Javier Segarra 2024-03-21 12:33:28 +01:00
parent f5d6c45339
commit 18d4be0ea2
1 changed files with 8 additions and 4 deletions

View File

@ -26,7 +26,7 @@ const value = computed({
emit('update:modelValue', value);
},
});
const focus = ref(false);
const hover = ref(false);
const styleAttrs = computed(() => {
return $props.isOutlined
? {
@ -45,6 +45,10 @@ const handleValue = (val = null) => {
value.value = val;
};
const focus = () => {
vnInputRef.value.focus();
};
defineExpose({
focus,
});
@ -52,8 +56,8 @@ defineExpose({
<template>
<div
@mouseover="focus = true"
@mouseleave="focus = false"
@mouseover="hover = true"
@mouseleave="hover = false"
:rules="$attrs.required ? [requiredFieldRule] : null"
>
<QInput
@ -74,7 +78,7 @@ defineExpose({
<QIcon
name="close"
size="xs"
v-if="focus && value"
v-if="hover && value"
@click="handleValue(null)"
></QIcon>
</template>