fix: clear link field value
This commit is contained in:
parent
a9c979b5d2
commit
f83b211a7f
@ -28,8 +28,8 @@
|
|||||||
<slot name="item-label" v-bind="{ active, selected, option }" />
|
<slot name="item-label" v-bind="{ active, selected, option }" />
|
||||||
</template>
|
</template>
|
||||||
|
|
||||||
<template v-if="attrs.onCreate" #footer="{ value, close }">
|
<template #footer="{ value, close }">
|
||||||
<div>
|
<div v-if="attrs.onCreate">
|
||||||
<Button
|
<Button
|
||||||
variant="ghost"
|
variant="ghost"
|
||||||
class="w-full !justify-start"
|
class="w-full !justify-start"
|
||||||
@ -41,6 +41,18 @@
|
|||||||
</template>
|
</template>
|
||||||
</Button>
|
</Button>
|
||||||
</div>
|
</div>
|
||||||
|
<div>
|
||||||
|
<Button
|
||||||
|
variant="ghost"
|
||||||
|
class="w-full !justify-start"
|
||||||
|
label="Clear"
|
||||||
|
@click="() => clearValue(close)"
|
||||||
|
>
|
||||||
|
<template #prefix>
|
||||||
|
<FeatherIcon name="x" class="h-4" />
|
||||||
|
</template>
|
||||||
|
</Button>
|
||||||
|
</div>
|
||||||
</template>
|
</template>
|
||||||
</Autocomplete>
|
</Autocomplete>
|
||||||
</div>
|
</div>
|
||||||
@ -145,6 +157,11 @@ function reload(val) {
|
|||||||
options.reload()
|
options.reload()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function clearValue(close) {
|
||||||
|
emit(valuePropPassed.value ? 'change' : 'update:modelValue', '')
|
||||||
|
close()
|
||||||
|
}
|
||||||
|
|
||||||
const labelClasses = computed(() => {
|
const labelClasses = computed(() => {
|
||||||
return [
|
return [
|
||||||
{
|
{
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user