From 75abdcde5ec9e72d0ec58de12600d5f46183d21c Mon Sep 17 00:00:00 2001 From: zernonia Date: Sat, 15 Jun 2024 17:18:32 +0800 Subject: [PATCH] feat: expose `open` value --- packages/vaul-vue/src/DrawerRoot.vue | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/packages/vaul-vue/src/DrawerRoot.vue b/packages/vaul-vue/src/DrawerRoot.vue index 40d1b68..0194408 100644 --- a/packages/vaul-vue/src/DrawerRoot.vue +++ b/packages/vaul-vue/src/DrawerRoot.vue @@ -28,6 +28,12 @@ const props = withDefaults(defineProps(), { const emit = defineEmits() +const slots = defineSlots<{ + default: (props: { + open: typeof isOpen.value + }) => any +}>() + const fadeFromIndex = computed(() => props.fadeFromIndex ?? (props.snapPoints && props.snapPoints.length - 1)) const open = useVModel(props, 'open', emit, { @@ -71,6 +77,10 @@ function handleOpenChange(o: boolean) { isOpen.value = o } } + +defineExpose({ + open: isOpen, +})