Skip to content

Commit 6a4cd4c

Browse files
committed
v0.17.0, add props , ,
1 parent 416df46 commit 6a4cd4c

File tree

10 files changed

+55
-19
lines changed

10 files changed

+55
-19
lines changed

README.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -238,14 +238,15 @@ toggle modal by name.
238238
## **Props**
239239

240240
```js
241-
const CLASS_TYPES = [String, Object, Array]
242-
243241
{
244242
value: { type: Boolean, default: false },
245243
ssr: { type: Boolean, default: true },
246-
classes: { type: CLASS_TYPES, default: '' },
247-
overlayClass: { type: CLASS_TYPES, default: '' },
248-
contentClass: { type: CLASS_TYPES, default: '' },
244+
classes: { type: [String, Object, Array], default: '' },
245+
overlayClass: { type: [String, Object, Array], default: '' },
246+
contentClass: { type: [String, Object, Array], default: '' },
247+
styles: { type: [String, Object, Array], default: '' },
248+
overlayStyle: { type: [String, Object, Array], default: '' },
249+
contentStyle: { type: [String, Object, Array], default: '' },
249250
lockScroll: { type: Boolean, default: true },
250251
hideOverlay: { type: Boolean, default: false },
251252
clickToClose: { type: Boolean, default: true },

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.

dist/VueFinalModal.umd.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.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/content/en/examples/recommended-use.md

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ title: Recommended use
33
description: 'Vue Final Modal is a renderless, stackable, detachable and lightweight modal component.'
44
position: 3
55
category: Examples
6+
version: 0.17
67
---
78

89

@@ -44,7 +45,8 @@ You can create a `higher-order component` easily and can customize `template`, `
4445
4546
<script>
4647
export default {
47-
name: 'VModal'
48+
name: 'VModal',
49+
inheritAttrs: false
4850
}
4951
</script>
5052

docs/content/en/index.md

Lines changed: 26 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ title: Introduction
33
description: 'Vue Final Modal is a renderless, stackable, detachable and lightweight modal component.'
44
position: 0
55
category: Getting Start
6-
version: 0.14
6+
version: 0.17
77
features:
88
- Support Vue 3 and Vue 2
99
- Tailwind CSS friendly
@@ -276,11 +276,35 @@ Custom class names for the modal content element.
276276

277277
### `overlayClass`
278278

279-
- Type: `String`
279+
- Type: `[String, Object, Array]`
280280
- Default: `''`
281281

282282
Custom class names for the modal overlay element.
283283

284+
### `styles`
285+
<badge>v0.17+</badge>
286+
287+
- Type: `[String, Object, Array]`
288+
- Default: `''`
289+
290+
Style that will be applied to the modal container element.
291+
292+
### `contentStyle`
293+
<badge>v0.17+</badge>
294+
295+
- Type: `[String, Object, Array]`
296+
- Default: `''`
297+
298+
Style that will be applied to the modal content element.
299+
300+
### `overlayStyle`
301+
<badge>v0.17+</badge>
302+
303+
- Type: `[String, Object, Array]`
304+
- Default: `''`
305+
306+
Style that will be applied to the modal overlay element.
307+
284308
### `transition`
285309

286310
- Type: `String`

example/src/components/hoc/VModal.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,8 @@
2323

2424
<script>
2525
export default {
26-
name: 'VModal'
26+
name: 'VModal',
27+
inheritAttrs: false
2728
}
2829
</script>
2930

lib/VueFinalModal.vue

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@
2020
v-show="!hideOverlay && visibility.overlay"
2121
class="vfm__overlay vfm--overlay vfm--absolute vfm--inset"
2222
:class="overlayClass"
23-
:aria-expanded="visibility.overlay.toString()"
23+
:style="overlayStyle"
2424
></div>
2525
</transition>
2626
<transition
@@ -35,6 +35,7 @@
3535
ref="vfmContainer"
3636
class="vfm__container vfm--absolute vfm--inset vfm--outline-none"
3737
:class="[classes, { 'vfm--cursor-pointer': clickToClose }]"
38+
:style="styles"
3839
:aria-expanded="visibility.modal.toString()"
3940
role="dialog"
4041
aria-modal="true"
@@ -44,6 +45,7 @@
4445
ref="vfmContent"
4546
class="vfm__content vfm--cursor-auto"
4647
:class="[contentClass, { 'vfm--prevent-auto': preventClick }]"
48+
:style="contentStyle"
4749
@click.stop
4850
>
4951
<slot />
@@ -72,17 +74,23 @@ function validateAttachTarget(val) {
7274
return val.nodeType === Node.ELEMENT_NODE
7375
}
7476
75-
const CLASS_TYPES = [String, Object, Array]
77+
const STYLE_PROP = {
78+
type: [String, Object, Array],
79+
default: ''
80+
}
7681
7782
export default {
7883
name: 'VueFinalModal',
7984
props: {
8085
name: { type: String, default: null },
8186
value: { type: Boolean, default: false },
8287
ssr: { type: Boolean, default: true },
83-
classes: { type: CLASS_TYPES, default: '' },
84-
overlayClass: { type: CLASS_TYPES, default: '' },
85-
contentClass: { type: CLASS_TYPES, default: '' },
88+
classes: STYLE_PROP,
89+
overlayClass: STYLE_PROP,
90+
contentClass: STYLE_PROP,
91+
styles: STYLE_PROP,
92+
overlayStyle: STYLE_PROP,
93+
contentStyle: STYLE_PROP,
8694
lockScroll: { type: Boolean, default: true },
8795
hideOverlay: { type: Boolean, default: false },
8896
clickToClose: { type: Boolean, default: true },

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "vue-final-modal",
3-
"version": "0.16.1",
3+
"version": "0.17.0",
44
"description": "Vue Final Modal is a renderless, stackable, detachable and lightweight modal component.",
55
"private": false,
66
"main": "dist/VueFinalModal.umd.js",

0 commit comments

Comments
 (0)