mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-15 04:29:37 +01:00
feat(Modal): open programmatically (#78)
Co-authored-by: Benjamin Canac <canacb1@gmail.com>
This commit is contained in:
18
playground/components/ModalProgrammaticExample.vue
Normal file
18
playground/components/ModalProgrammaticExample.vue
Normal file
@@ -0,0 +1,18 @@
|
||||
<script lang="ts" setup>
|
||||
const modal = useModal()
|
||||
|
||||
defineProps<{
|
||||
count: number
|
||||
}>()
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<UModal title="This modal was opened programmatically">
|
||||
<template #footer>
|
||||
<div class="flex w-full justify-between">
|
||||
<p>Count: {{ count }}</p>
|
||||
<UButton color="gray" label="Close" @click="modal.close()" />
|
||||
</div>
|
||||
</template>
|
||||
</UModal>
|
||||
</template>
|
||||
Reference in New Issue
Block a user