-
Notifications
You must be signed in to change notification settings - Fork 0
/
app.vue
40 lines (36 loc) · 819 Bytes
/
app.vue
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
<script setup lang="ts">
import { Modal1 } from '#components'
const { configs, open, close } = useModalNew()
function callModal() {
open(Modal1)
}
</script>
<template>
<NuxtLayout>
<UButton @click="callModal">
Call modal 1
</UButton>
<UModal
v-for="(modal, key) in configs"
:key="key"
:model-value="true"
prevent-close
@close="close"
>
<UCard :ui="{ divide: 'divide-y divide-gray-100' }">
<template #header>
<div class="flex justify-end p-2">
<UButton @click="close">
Close
</UButton>
</div>
</template>
<component
:is="modal.component"
v-bind="modal.props"
@submit="close"
/>
</UCard>
</UModal>
</NuxtLayout>
</template>