1
0
forked from test/crm

fix: clear link field value

This commit is contained in:
Shariq Ansari 2024-03-12 11:37:11 +05:30
parent a9c979b5d2
commit f83b211a7f

View File

@ -28,8 +28,8 @@
<slot name="item-label" v-bind="{ active, selected, option }" />
</template>
<template v-if="attrs.onCreate" #footer="{ value, close }">
<div>
<template #footer="{ value, close }">
<div v-if="attrs.onCreate">
<Button
variant="ghost"
class="w-full !justify-start"
@ -41,6 +41,18 @@
</template>
</Button>
</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>
</Autocomplete>
</div>
@ -145,6 +157,11 @@ function reload(val) {
options.reload()
}
function clearValue(close) {
emit(valuePropPassed.value ? 'change' : 'update:modelValue', '')
close()
}
const labelClasses = computed(() => {
return [
{