mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-27 18:30:35 +01:00
chore(Slideover): emit event
This commit is contained in:
@@ -1,6 +1,6 @@
|
|||||||
<template>
|
<template>
|
||||||
<TransitionRoot as="template" :appear="appear" :show="isOpen">
|
<TransitionRoot as="template" :appear="appear" :show="isOpen">
|
||||||
<Dialog :class="[wrapperClass, { 'justify-end': side === 'right' }]" @close="isOpen = false">
|
<Dialog :class="[wrapperClass, { 'justify-end': side === 'right' }]" @close="close">
|
||||||
<TransitionChild
|
<TransitionChild
|
||||||
v-if="overlay"
|
v-if="overlay"
|
||||||
as="template"
|
as="template"
|
||||||
@@ -89,7 +89,7 @@ const props = defineProps({
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
const emit = defineEmits(['update:modelValue'])
|
const emit = defineEmits(['update:modelValue', 'close'])
|
||||||
|
|
||||||
const isOpen: WritableComputedRef<boolean> = computed({
|
const isOpen: WritableComputedRef<boolean> = computed({
|
||||||
get () {
|
get () {
|
||||||
@@ -129,6 +129,11 @@ const slideoverTransition = computed(() => {
|
|||||||
...props.transitionClass
|
...props.transitionClass
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
||||||
|
function close (value: boolean) {
|
||||||
|
isOpen.value = value
|
||||||
|
emit('close')
|
||||||
|
}
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<script lang="ts">
|
<script lang="ts">
|
||||||
|
|||||||
Reference in New Issue
Block a user