Skip to content

Commit 9bc670c

Browse files
committed
docs: sync with v2
1 parent 748ca19 commit 9bc670c

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

42 files changed

+412
-304
lines changed

dist/VueFinalModal.esm.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

dist/VueFinalModal.umd.js.map

Lines changed: 1 addition & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

docs/components/examples/basic/BasicOptions.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div class="pb-8">
3-
<v-modal
3+
<custom-modal
44
v-model="showModal"
55
:ssr="ssr"
66
:lock-scroll="lockScroll"
@@ -31,7 +31,7 @@
3131
>
3232
<template #title># Hello, world!</template>
3333
<p>Lorem Ipsum is simply dummy text of the printing and typesetting industry.</p>
34-
</v-modal>
34+
</custom-modal>
3535

3636
<div class="flex space-x-2">
3737
<v-button highlight @click="showModal = true">Open Modal</v-button>

docs/components/examples/basic/VAccessibility.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<template>
22
<div>
3-
<v-modal v-model="show" focus-trap @confirm="show = false" @cancel="show = false">
3+
<custom-modal v-model="show" focus-trap @confirm="show = false" @cancel="show = false">
44
<template #title>Hello, vue-final-modal</template>
55
<p>Vue Final Modal is a renderless, stackable, detachable and lightweight modal component.</p>
6-
</v-modal>
6+
</custom-modal>
77

88
<v-button highlight @click="show = true">Open modal</v-button>
99
</div>

docs/components/examples/basic/VApiShow.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<template>
22
<div>
3-
<v-modal v-model="showModal" name="VApiShow" @confirm="showModal = false" @cancel="showModal = false">
3+
<custom-modal v-model="showModal" name="VApiShow" @confirm="showModal = false" @cancel="showModal = false">
44
<template #default="{ params }">Hi {{ params.userName }}</template>
55
<template #title>$vfm.show</template>
6-
</v-modal>
6+
</custom-modal>
77
<v-button highlight @click="$vfm.show('VApiShow', { userName: 'vue-final-modal' })">Open modal</v-button>
88
</div>
99
</template>

docs/components/examples/basic/VDynamicAdvanced.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,12 @@ export default {
99
methods: {
1010
dynamic() {
1111
this.$vfm.show({
12-
component: 'VModal',
12+
component: 'CustomModal',
1313
bind: {
1414
name: 'VDynamicAdvacedModal'
1515
},
1616
on: {
17-
// event by v-modal
17+
// event by custom-modal
1818
confirm(close) {
1919
console.log('confirm')
2020
close()

docs/components/examples/basic/VEvents.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
<template>
22
<div>
3-
<v-modal
3+
<custom-modal
44
v-model="showModal"
55
@click-outside="clickOutside"
66
@before-open="beforeOpen"
@@ -10,7 +10,7 @@
1010
@cancel="showModal = false"
1111
>
1212
<template #title>Events Example!</template>
13-
</v-modal>
13+
</custom-modal>
1414
<v-button highlight @click="showModal = true">Open modal</v-button>
1515
</div>
1616
</template>

docs/components/examples/hoc/VModal.vue renamed to docs/components/examples/hoc/CustomModal.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424

2525
<script>
2626
export default {
27-
name: 'VModal',
27+
name: 'CustomModal',
2828
inheritAttrs: false
2929
}
3030
</script>

docs/components/examples/hoc/HocExample.vue

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,9 @@
11
<template>
22
<div>
3-
<v-modal v-model="show" @confirm="confirm" @cancel="cancel">
3+
<custom-modal v-model="show" @confirm="confirm" @cancel="cancel">
44
<template #title>Hello, vue-final-modal</template>
55
<p>Vue Final Modal is a renderless, stackable, detachable and lightweight modal component.</p>
6-
</v-modal>
6+
</custom-modal>
77

88
<v-button highlight @click="show = true">Open modal</v-button>
99
</div>

docs/content/en/api.md

Lines changed: 18 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,21 @@ version: 3
99

1010
<alert>`$vfm` is an object containing VueFinalModal's data/methods.</alert>
1111

12+
### **Directly import**
13+
14+
```js
15+
import { $vfm } from 'vue-final-modal'
16+
```
17+
1218
### **Options API**
1319

20+
If you register plugin globally.
1421
Just use `this.$vfm`.
1522

16-
### **Composition API** <badge>Vue 3 only</badge>
23+
### **Composition API**
24+
25+
If you register plugin globally.
26+
You can use `inject('$vfm')` in `setup`.
1727

1828
```js
1929
import { inject } from 'vue'
@@ -26,7 +36,7 @@ export default {
2636
```
2737
## API
2838

29-
### `show(name, params)`
39+
### `$vfm.show(name, params)`
3040

3141
- Type: `Function`
3242
- Arguments:
@@ -68,7 +78,7 @@ export default {
6878

6979
<alert>`v-model` is necessary when you open a modal with `$vfm.show(name)` API.</alert>
7080

71-
### `hide([names])`
81+
### `$vfm.hide([names])`
7282

7383
- Type: `Function`
7484
- Arguments:
@@ -103,7 +113,7 @@ export default {
103113

104114
</sfc-view>
105115

106-
### `hideAll()`
116+
### `$vfm.hideAll()`
107117

108118
- Returns: `Promise<Object>` | `Promise<Array>`
109119
- Example:
@@ -122,7 +132,7 @@ this.$vfm.hideAll().then(() => {
122132
})
123133
```
124134

125-
### `toggle(name, show, params)`
135+
### `$vfm.toggle(name, show, params)`
126136

127137
- Type: `Function`
128138
- Arguments:
@@ -140,7 +150,7 @@ this.$vfm.hideAll().then(() => {
140150

141151
Toggle modals by name.
142152

143-
### `get([names])`
153+
### `$vfm.get([names])`
144154

145155
Get the modal instances by modal names.
146156

@@ -154,7 +164,7 @@ Get the modal instances by modal names.
154164
const modals = this.$vfm.get('modalName1', 'modalName2', ...)
155165
```
156166

157-
### `openedModals`
167+
### `$vfm.openedModals`
158168

159169
- Return:
160170
- `Array`: returns the opened modal instances.
@@ -169,7 +179,7 @@ Get the modal instances by modal names.
169179
```
170180

171181

172-
### `modals`
182+
### `$vfm.modals`
173183

174184
- Return:
175185
- `Array`: returns all modal instances.

0 commit comments

Comments
 (0)