fixed no trigger element

This commit is contained in:
Mamalizz
2025-03-09 20:37:50 +03:30
parent 69c947122d
commit 4c04feab73
+13 -9
View File
@@ -26,13 +26,17 @@ const emit = defineEmits<Emits>();
// computed
const isShow = computed({
get: () => modelValue.value ?? false,
set: (value) => {
emit("update:modelValue", value);
emit("close", null);
},
});
const isShow = ref(modelValue.value);
watch(
() => isShow.value,
(nv) => {
if (!nv) {
emit("update:modelValue", false);
emit("close", null);
}
}
);
</script>
<template>
@@ -44,7 +48,7 @@ const isShow = computed({
}
"
>
<DialogTrigger>
<DialogTrigger :class="!$slots['trigger'] ? 'hidden' : ''">
<slot name="trigger" />
</DialogTrigger>
<DialogPortal>
@@ -64,7 +68,7 @@ const isShow = computed({
class="data-[state=open]:animate-content-show text-black font-iran-yekan-x focus:outline-none z-[100]"
>
<div
class="rounded-3xl bg-white shadow-[hsl(206_22%_7%_/_35%)_0px_10px_38px_-10px,_hsl(206_22%_7%_/_20%)_0px_10px_20px_-15px]"
class="rounded-2xl bg-white shadow-[hsl(206_22%_7%_/_35%)_0px_10px_38px_-10px,_hsl(206_22%_7%_/_20%)_0px_10px_20px_-15px]"
>
<div
class="w-full flex items-center px-6 justify-between py-[1.5rem] border-b border-slate-200"