mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-14 20:19:34 +01:00
25 lines
458 B
Vue
25 lines
458 B
Vue
<script setup lang="ts">
|
|
import { ModalExampleComponent } from '#components'
|
|
|
|
const toast = useToast()
|
|
const modal = useModal()
|
|
const count = ref(0)
|
|
|
|
function openModal () {
|
|
count.value += 1
|
|
modal.open(ModalExampleComponent, {
|
|
count: count.value,
|
|
onSuccess () {
|
|
toast.add({
|
|
title: 'Success !',
|
|
id: 'modal-success'
|
|
})
|
|
}
|
|
})
|
|
}
|
|
</script>
|
|
|
|
<template>
|
|
<UButton label="Reveal modal" @click="openModal" />
|
|
</template>
|