Skip to content

Commit daf56a0

Browse files
committed
docs: update docs
1 parent cf17e0e commit daf56a0

File tree

4 files changed

+49
-2
lines changed

4 files changed

+49
-2
lines changed

packages/docs/components/content/ConfirmModal.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ const emit = defineEmits<{
1414
<template>
1515
<VueFinalModal
1616
class="flex justify-center items-center"
17-
content-class="flex flex-col p-4 bg-white dark:bg-black rounded-lg space-y-2"
17+
content-class="flex flex-col max-w-xl mx-4 p-4 bg-white dark:bg-black border dark:border-gray-700 rounded-lg space-y-2"
1818
@update:model-value="val => emit('update:modelValue', val)"
1919
>
2020
<h1 class="text-xl">
Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
<script setup lang="ts">
2+
import { ModalsContainer, useModal } from 'vue-final-modal'
3+
import ConfirmModal from './ConfirmModal.vue'
4+
5+
const confirm1 = useModal({
6+
component: markRaw(ConfirmModal),
7+
attrs: {
8+
title: 'The first confirm modal',
9+
onConfirm() {
10+
openConfirm2()
11+
},
12+
},
13+
slots: {
14+
default: 'Magna deserunt nulla aliquip velit aute. Et occaecat elit nulla excepteur labore cupidatat. Duis culpa mollit commodo dolor qui Lorem qui laborum elit elit Lorem occaecat. Commodo eiusmod esse voluptate officia amet quis occaecat aliqua. Proident do irure amet ut occaecat dolor laboris consectetur.',
15+
},
16+
})
17+
18+
const confirm2 = useModal({
19+
component: markRaw(ConfirmModal),
20+
attrs: {
21+
title: 'The second confirm modal',
22+
onConfirm() {
23+
confirm2.close()
24+
},
25+
},
26+
})
27+
28+
function openConfirm2() {
29+
confirm2.open()
30+
}
31+
</script>
32+
33+
<template>
34+
<VButton @click="() => confirm1.open()">
35+
Open Modal
36+
</VButton>
37+
38+
<ModalsContainer />
39+
</template>

packages/docs/content/4.use-cases/1.use-cases/4.form-modal.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,10 @@ head.title: 'Form Modal | Examples'
44

55
# Form Modal
66

7+
A example that use form component in vue-final-modal.
8+
9+
This example use [Vorms](https://vorms.mini-ghost.dev/) to handle the form validate.
10+
711
::code-group
812
::code-block{label="Preview" preview}
913
::form-modal-preview

packages/docs/content/4.use-cases/1.use-cases/5.nested-modal.md

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,4 +4,8 @@ head.title: 'Nested Modal | Examples'
44

55
# Nested Modal
66

7-
TBD
7+
::code-group
8+
::code-block{label="Preview" preview}
9+
::nested-modal-preview
10+
::
11+
::

0 commit comments

Comments
 (0)