You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@@ -188,15 +185,15 @@ Changes component name from "VueFinalModal" to any other string value. It is use
188
185
- Type: `String`
189
186
- default: `'$vfm'`
190
187
191
-
Changes API name from "$vfm" to any other string value. It is useful when you use `vue-final-modal` as spinner, toast, notify, etc.
188
+
Changes API name from "\$vfm" to any other string value. It is useful when you use `vue-final-modal` as spinner, toast, notify, etc.
192
189
193
190
## **API**
194
191
195
-
-In Options API:
192
+
-**Options API**
196
193
197
194
Plugin API can be called within any component through `this.$vfm`.
198
195
199
-
-In Composition API:
196
+
-**Composition API** <badge>Only in Vue 3 version</badge>
200
197
201
198
```js
202
199
import { inject } from'vue'
@@ -229,25 +226,28 @@ Or get `params` on `@beforeOpen` event:
229
226
</vue-final-modal>
230
227
```
231
228
232
-
> `parmas` will be reset to `{}` automatically after `closed` event. You can avoid the modal to reset the `params` to empty object by calling `event.stop()`.
229
+
<alert>`parmas` will be reset to `{}` automatically after `closed` event. You can avoid the modal to reset the `params` to empty object by calling `event.stop()`.</alert>
233
230
234
231
- Example:
235
232
236
233
```html
237
234
<template>
238
-
<vue-final-modalv-model="show"name="example">Vue Final Modal is awesome</vue-final-modal>
<vue-final-modalv-model="show"name="example">Vue Final Modal is awesome</vue-final-modal>
263
+
<vue-final-modalv-model="show"name="example">Vue Final Modal is awesome</vue-final-modal>
264
264
</template>
265
265
266
266
<script>
267
-
exportdefault {
268
-
name:'MyComponent',
267
+
exportdefault {
269
268
data: () => ({
270
269
show:true
271
270
}),
272
-
mounted() {
273
-
this.$vfm.hide('example')
271
+
mounted() {
272
+
this.$vfm.hide('example')
274
273
}
275
-
}
274
+
}
276
275
</script>
277
276
```
278
277
@@ -302,7 +301,7 @@ Or get `params` on `@beforeOpen` event:
302
301
</vue-final-modal>
303
302
```
304
303
305
-
> `parmas` will be reset to `{}` automatically after `closed` event. You can avoid the modal to reset the `params` to empty object by calling `event.stop()`.
304
+
<alert>`parmas` will be reset to `{}` automatically after `closed` event. You can avoid the modal to reset the `params` to empty object by calling `event.stop()`.</alert>
306
305
307
306
toggle modal by name.
308
307
@@ -321,6 +320,7 @@ return the modal comopnent instance.
321
320
A stack array store the opened modal's vue component instance.
322
321
323
322
You can use:
323
+
324
324
1.`$vfm.openedModals[0]` to get the first opened modal instance.
325
325
2.`$vfm.openedModals.length` to get how many modals is opened.
326
326
@@ -464,7 +464,7 @@ Set the root element of `vue-final-modal` style to `pointer-events: none;`.
464
464
465
465
Specifies which DOM element that this component should detach to.
466
466
467
-
1. Set `false` will disabled this feature.
467
+
1. Set `false` will disabled this feature.
468
468
2. String can be any valid `querySelector`, e.g. `'body'`, `'#app'`.
469
469
3. Object can be any valid `Node`, e.g. `this.$refs.container`.
470
470
@@ -513,21 +513,20 @@ Enables focus trap meaning that only inputs/buttons that are withing the modal w
513
513
514
514
```vue
515
515
<template>
516
-
<vue-final-modal
517
-
@click-outside="clickOutside"
518
-
@before-open="beforeOpen"
519
-
@opened="opened"
520
-
@before-close="beforeClose"
521
-
@closed="closed"
522
-
>
523
-
...modal content
524
-
</vue-final-modal>
516
+
<vue-final-modal
517
+
@click-outside="clickOutside"
518
+
@before-open="beforeOpen"
519
+
@opened="opened"
520
+
@before-close="beforeClose"
521
+
@closed="closed"
522
+
>
523
+
...modal content
524
+
</vue-final-modal>
525
525
</template>
526
526
```
527
527
528
528
</show-code>
529
529
530
-
531
530
### `@click-outside`
532
531
533
532
- Emits while modal container on click.
@@ -544,7 +543,7 @@ If prop `clickToClose` is `false`, the event will still be emitted.
544
543
545
544
### `@opened`
546
545
547
-
- Emits after modal became visible and transition ended.
546
+
- Emits after modal became visible and transition ended.
548
547
549
548
### `@before-close`
550
549
@@ -572,12 +571,11 @@ Or get `params` on `@beforeOpen` event:
572
571
</vue-final-modal>
573
572
```
574
573
575
-
> `parmas` will be reset to `{}` automatically after `closed` event. You can avoid the modal to reset the `params` to empty object by calling `event.stop()`.
576
-
574
+
<alert>`parmas` will be reset to `{}` automatically after `closed` event. You can avoid the modal to reset the `params` to empty object by calling `event.stop()`.</alert>
577
575
578
576
## **Contribution**
579
577
580
-
👋 Hi I'm Hunter, the author of `vue-final-modal`.
578
+
👋 Hi I'm Hunter, the author of `vue-final-modal`.
581
579
582
580
To develop vue-final-modal, I learn a lot from these awesome libraries:
583
581
@@ -594,6 +592,6 @@ To develop vue-final-modal, I learn a lot from these awesome libraries:
594
592
-[Bootstrap Vue](https://bootstrap-vue.org/)
595
593
- lockScroll
596
594
597
-
> There is no perfect library even the `final` of vue modal.
595
+
<alert>There is no perfect library even the `final` of vue modal.</alert>
598
596
599
-
If you have any ideas for optimization of `vue-final-modal`, feel free to open [issues](https://github.com/hunterliu1003/vue-final-modal/issues) or [pull requests](https://github.com/hunterliu1003/vue-final-modal/pulls).
597
+
🚀 If you have any ideas for optimization of `vue-final-modal`, feel free to open [issues](https://github.com/hunterliu1003/vue-final-modal/issues) or [pull requests](https://github.com/hunterliu1003/vue-final-modal/pulls).
0 commit comments