Skip to content

Commit 09a0d33

Browse files
committed
Merge branch 'feature/test' into feature/multiple-endpoint-types
2 parents 57800a7 + 0f86462 commit 09a0d33

24 files changed

+1556
-930
lines changed
Lines changed: 36 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,36 @@
1+
---
2+
name: "\U0001F41B Bug report"
3+
about: "If something isn't working \U0001F915"
4+
title: ''
5+
labels: bug
6+
assignees: hunterliu1003
7+
8+
---
9+
10+
<!-- **IMPORTANT!**
11+
Before reporting a bug, please make sure that you have read through our documentation and you think your problem is indeed an issue related to our module. -->
12+
13+
### Version
14+
15+
vue-final-modal: <!-- ex: v0.19.0 -->
16+
vue: <!-- ex: v2.6.12 -->
17+
nuxt: <!-- ex: v2.12.0 -->
18+
19+
### OS
20+
21+
Mac or Windows
22+
23+
### Reproduction Link
24+
<!--
25+
A minimal test case based on one of:
26+
- a fork of https://codesandbox.io/s/nuxtcontent-demo-l164h
27+
- a GitHub repository that can reproduce the bug
28+
-->
29+
30+
### Steps to reproduce
31+
32+
33+
### What is Expected?
34+
35+
36+
### What is actually happening?
Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
---
2+
name: "\U0001F680 Feature request"
3+
about: "Let us know if you have a feature request \U0001F4A1"
4+
title: ''
5+
labels: enhancement
6+
assignees: hunterliu1003
7+
8+
---
9+
10+
### Is your feature request related to a problem? Please describe.
11+
<!-- A clear and concise description of what the problem is. Ex. I'm always frustrated when [...] -->
12+
13+
### Describe the solution you'd like
14+
<!-- A clear and concise description of what you want to happen. -->
15+
16+
### Describe alternatives you've considered
17+
<!-- A clear and concise description of any alternative solutions or features you've considered. -->
18+
19+
### Additional context
20+
<!-- Add any other context or screenshots about the feature request here. -->
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
---
2+
name: "❤️ Say thank you"
3+
about: Tell us how you use vue-final-modal & support our efforts in maintaining vue-final-modal
4+
title: ''
5+
labels: ''
6+
assignees: hunterliu1003
7+
8+
---
9+
10+
# ❤️ I'm using **`vue-final-modal`**
11+
12+
If you (or your company) are using **`vue-final-modal`** - please let us know. We'd love to hear from you!
13+
14+
**`vue-final-modal`** is a community driven project, which means it's not maintained by a company. If you would like to help `vue-final-modal` - any of the following is greatly appreciated.
15+
16+
- [ ] Give the repository a star ⭐️
17+
- [ ] Help out with issues
18+
- [ ] Review pull requests
19+
- [ ] Blog about vue-final-modal
20+
- [ ] Make tutorials
21+
- [ ] Give talks
22+
23+
Thank you! 💐

.github/ISSUE_TEMPLATE/-question.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
---
2+
name: "❓Question"
3+
about: Ask a question about vue-final-modal
4+
title: ''
5+
labels: question
6+
assignees: hunterliu1003
7+
8+
---
9+
10+
<!-- **IMPORTANT!**
11+
Please make sure to look for an answer to your question in our documentation and the documentation before asking a question here.
12+
-->

README.md

Lines changed: 85 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,8 @@ Looking for a Vue 3 version? [It's over here](https://github.com/hunterliu1003/v
3030

3131
## Introduction
3232

33-
`Vue Final Modal` is a renderless component<br />
33+
### **Vue Final Modal** is a **renderless component**!
34+
3435
You can create a [higher-order component](https://vue-final-modal.org/examples/recommended-use) easily and can customize `template`, `script` and `style` based on your needs.
3536

3637
features:
@@ -199,11 +200,29 @@ You can use:
199200

200201
All modal instances include show and hide.
201202

202-
### `$vfm.show(name)`
203+
### `$vfm.show(name, params)`
203204

204205
- Type: `Function`
205206
- Arguments:
206207
- name: `String` - Name of the modal
208+
- params: `?: object` - Any data that you would want to pass into the modal (@before-open event handler will contain `params` in the event). You can also using scoped-slot to get `params` in template:
209+
210+
```html
211+
<template v-slot="{ params }">
212+
<!-- modal content -->
213+
</template>
214+
```
215+
216+
Or get `params` on `@beforeOpen` event:
217+
218+
```html
219+
<vue-final-modal @beforeOpen="e => e.ref.params">
220+
<!-- modal content -->
221+
</vue-final-modal>
222+
```
223+
224+
> `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()`.
225+
207226
- Example:
208227

209228
```html
@@ -253,12 +272,29 @@ export default {
253272

254273
hide all modals.
255274

256-
### `$vfm.toggle(name, show)`
275+
### `$vfm.toggle(name, show, params)`
257276

258277
- Type: `Function`
259278
- Arguments:
260279
- name: `String` - Name of the modal
261-
- show: `Boolean` - Show modal or not
280+
- show: `?: Boolean` - Show modal or not
281+
- params: `?: object` - Any data that you would want to pass into the modal (@before-open event handler will contain params in the event). You can also using scoped-slot to get `params` in template:
282+
283+
```html
284+
<template v-slot="{ params }">
285+
<!-- modal content -->
286+
</template>
287+
```
288+
289+
Or get `params` on `@beforeOpen` event:
290+
291+
```html
292+
<vue-final-modal @beforeOpen="e => e.ref.params">
293+
<!-- modal content -->
294+
</vue-final-modal>
295+
```
296+
297+
> `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()`.
262298
263299
toggle modal by name.
264300

@@ -277,12 +313,14 @@ toggle modal by name.
277313
lockScroll: { type: Boolean, default: true },
278314
hideOverlay: { type: Boolean, default: false },
279315
clickToClose: { type: Boolean, default: true },
316+
escToClose: { type: Boolean, default: false },
280317
preventClick: { type: Boolean, default: false },
281318
attach: { type: null, default: false, validator: validateAttachTarget },
282319
transition: { type: String, default: 'vfm' },
283320
overlayTransition: { type: String, default: 'vfm' },
284321
zIndexBase: { type: [String, Number], default: 1000 },
285322
zIndex: { type: [Boolean, String, Number], default: false },
323+
focusRetain: { type: Boolean, default: true },
286324
focusTrap: { type: Boolean, default: false }
287325
}
288326
```
@@ -297,20 +335,59 @@ toggle modal by name.
297335
298336
### `@before-open`
299337

300-
- Emits while modal is still invisible, but before transition starting.
338+
- Emits while modal is still invisible, but before transition starting. Further opening of the modal can be blocked from this event listener by calling `event.stop()`.
301339

302340
### `@opened`
303341

304342
- Emits after modal became visible and transition ended.
305343

306344
### `@before-close`
307345

308-
- Emits before modal is going to be closed.
346+
- Emits before modal is going to be closed. Further closing of the modal can be blocked from this event listener by calling `event.stop()`.
309347

310348
### `@closed`
311349

312-
- Emits right before modal is destroyed.
350+
- Emits right before modal is destroyed. Further after the modal was closed, you can avoid the modal to reset the `params` to empty object by calling `event.stop()`.
351+
352+
## **Slots**
353+
354+
If you open a modal though API `show(name, params)`, You can using scoped-slot to get `params` in template:
355+
356+
```html
357+
<template v-slot="{ params }">
358+
<!-- modal content -->
359+
</template>
360+
```
361+
362+
Or get `params` on `@beforeOpen` event:
363+
364+
```html
365+
<vue-final-modal @beforeOpen="e => e.ref.params">
366+
<!-- modal content -->
367+
</vue-final-modal>
368+
```
369+
370+
> `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()`.
371+
372+
## **Contribution**
373+
374+
👋 Hi I'm Hunter, the author of `vue-final-modal`.
375+
376+
To develop vue-final-modal, I learn a lot from these awesome libraries:
377+
378+
- [Vuetify](https://vuetifyjs.com/en/)
379+
- attach
380+
- [Element UI](https://element.eleme.io/)
381+
- stackable modal
382+
- zIndex
383+
- zIndexBase
384+
- [vue-js-modal](https://github.com/euvl/vue-js-modal)
385+
- dynamic modal
386+
- transition
387+
- focusTrap for A11y
388+
- [Bootstrap Vue](https://bootstrap-vue.org/)
389+
- lockScroll
313390

314-
## Contribution
391+
> There is no perfect library even the `final` of vue modal.
315392
316393
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).

dist/VueFinalModal.esm.js

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.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.

0 commit comments

Comments
 (0)