-
-
Notifications
You must be signed in to change notification settings - Fork 25
/
Copy pathLocal.vue
43 lines (34 loc) · 999 Bytes
/
Local.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
41
42
43
<script setup>
import Container from './Container.vue'
import { Modal, ModalLink } from '@inertiaui/modal-vue'
import { ref } from 'vue';
const modalRef = ref(null);
function closeModal() {
modalRef.value.close();
}
function alertModalId() {
alert(modalRef.value.id);
}
</script>
<template>
<Container>
<div class="flex justify-between">
<h2 class="text-lg font-medium text-gray-900">Local</h2>
<ModalLink href="#local" class="px-2 py-1 text-xs font-medium text-indigo-600 bg-indigo-100 rounded-md">
Open Local Modal
</ModalLink>
</div>
</Container>
<Modal name="local" ref="modalRef">
This is a local modal
<ModalLink href="/roles/create">
Create Role
</ModalLink>
<button @click="closeModal">
Close Modal through Ref
</button>
<button @click="alertModalId">
Alert Modal ID
</button>
</Modal>
</template>