Skip to content

Commit c629ae6

Browse files
committed
Co ntrollable Modal component
1 parent ae28f29 commit c629ae6

File tree

1 file changed

+33
-0
lines changed

1 file changed

+33
-0
lines changed
Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<template>
2+
<ion-modal
3+
:is-open="modalOpenRef"
4+
@didDismiss="closeModal()"
5+
>
6+
<ion-page>
7+
<slot></slot>
8+
</ion-page>
9+
</ion-modal>
10+
</template>
11+
12+
<script setup>
13+
// eslint-disable-next-line no-undef
14+
const modalOpenRef = ref(false)
15+
16+
function openModal() {
17+
modalOpenRef.value = true
18+
}
19+
20+
function closeModal() {
21+
modalOpenRef.value = false
22+
}
23+
24+
// eslint-disable-next-line no-undef
25+
defineExpose({
26+
openModal,
27+
closeModal
28+
})
29+
30+
</script>
31+
32+
<style lang="scss" scoped>
33+
</style>

0 commit comments

Comments
 (0)