Skip to content

Commit a2a7535

Browse files
committed
docs: update docs
1 parent ce3443e commit a2a7535

File tree

1 file changed

+41
-0
lines changed

1 file changed

+41
-0
lines changed

docs/content/2.get-started/1.guide/2.setup.md

Lines changed: 41 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,8 @@ How to start with Vue Final Modal, by creating a fresh new project or adding it
2222

2323
## Plugin registration
2424

25+
In vue-final-modal 4, it's necessary to create a plugin by `createVfm()`{lang=ts} and register it because vue-final-modal 4 has some shared context that is based on provide/inject.
26+
2527
### Vue 3
2628

2729
```ts [main.ts]
@@ -49,6 +51,8 @@ export default defineNuxtPlugin((nuxtApp) => {
4951

5052
## Import required CSS
5153

54+
vue-final-modal 4 has tiny size of required CSS (gzipped 0.49kb). All classes have a `.vfm-` prefix, so you don't have to worry about any CSS pollution. _[See style of `<VueFinalModal>`.](https://github.com/vue-final/vue-final-modal/blob/v4/packages/vue-final-modal/src/components/CoreModal/CoreModal.vue#L184-L217)_
55+
5256
### Vue 3
5357

5458
```ts [main.ts]
@@ -64,6 +68,43 @@ export default defineNuxtConfig({
6468

6569
```
6670

71+
## Add `<ModalsContainer>` to Vue tree
72+
73+
`<ModalsContainer>` is a container for the dynamic modals that created by `useModal()`.
74+
75+
You don't need to do add anything else to the `<ModalsContainer>`{lang=ts}, as long as you include it in your Vue tree, you can use Dynamic modals.
76+
77+
### Vue 3
78+
79+
```vue [App.vue]
80+
<script setup lang="ts">
81+
import { ModalsContainer } from 'vue-final-modal'
82+
</script>
83+
84+
<template>
85+
<div>
86+
...
87+
<ModalsContainer />
88+
</div>
89+
</template>
90+
```
91+
92+
### Nuxt 3
93+
94+
```vue [layouts/default.vue]
95+
<script setup lang="ts">
96+
import { ModalsContainer } from 'vue-final-modal'
97+
</script>
98+
99+
<template>
100+
<div>
101+
Some default layout shared across all pages
102+
<slot />
103+
<ModalsContainer />
104+
</div>
105+
</template>
106+
```
107+
67108
## Style a modal
68109

69110
Define a styled modal for yourself. Here will create a styled `<ConfirmModal>`{lang=ts} with `<VueFinalModal>`{lang=ts} as an example.

0 commit comments

Comments
 (0)