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
Copy file name to clipboardExpand all lines: docs/Intro.md
+51-54Lines changed: 51 additions & 54 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,8 @@
2
2
3
3
The library supports 2 types of modals - static and dynamic.
4
4
5
-
***Static** are defined explicitly though the template.
6
-
***Dynamic** are generated based on the configuration passed into the "show modal" function.
5
+
-**Static** are defined explicitly though the template.
6
+
-**Dynamic** are generated based on the configuration passed into the "show modal" function.
7
7
8
8
## Static modals
9
9
@@ -30,30 +30,29 @@ export default {
30
30
mount () {
31
31
this.show()
32
32
}
33
-
}
33
+
}
34
34
</script>
35
35
```
36
36
37
37
## Dynamic modals
38
38
39
39
In order to instantiate modals at runtime (for lazy-loading or de-cluttering templates), it is possible to create modals dynamically.
40
40
41
-
42
-
To show dynamic modal you can use the same `$modal.show` function with extended API:
41
+
To show dynamic modal you can use the same `$modal.show` function with extended API:
43
42
44
43
```js
45
44
this.$modal.show(
46
-
component,
47
-
component_properties,
48
-
modal_properties,
49
-
modal_events
45
+
component,
46
+
component_properties,
47
+
modal_properties,
48
+
modal_events
50
49
)
51
50
```
52
51
53
-
*`component` - inline or imported Vue component definition
54
-
*`component_properties` - any properties that are used within the `component_definition`
55
-
*`modal_properties` -modal component properties (see Properties section)
56
-
*`modal_events` - modal event handlers (see Events section)
52
+
-`component` - inline or imported Vue component definition
53
+
-`component_properties` - any properties that are used within the `component_definition`
54
+
-`modal_properties` -modal component properties (see Properties section)
55
+
-`modal_events` - modal event handlers (see Events section)
57
56
58
57
Using **imported** component definition:
59
58
@@ -63,9 +62,9 @@ import MyComponent from './MyComponent.vue'
63
62
...
64
63
65
64
this.$modal.show(
66
-
MyComponent,
67
-
{ text:'This text is passed as a property' },
68
-
{ draggable:true }
65
+
MyComponent,
66
+
{ text:'This text is passed as a property' },
67
+
{ draggable:true }
69
68
)
70
69
```
71
70
@@ -75,18 +74,18 @@ Using **inline** component definition:
75
74
76
75
```js
77
76
this.$modal.show(
78
-
{
79
-
template:`
80
-
<div>
81
-
<h1>This is created inline</h1>
82
-
<p>{{ text }}</p>
83
-
</div>
84
-
`,
85
-
props: ['text']
86
-
},
87
-
{ text:'This text is passed as a property' },
88
-
{ height:'auto' },
89
-
{ 'before-close':(event)=> {} }
77
+
{
78
+
template:`
79
+
<div>
80
+
<h1>This is created inline</h1>
81
+
<p>{{ text }}</p>
82
+
</div>
83
+
`,
84
+
props: ['text']
85
+
},
86
+
{ text:'This text is passed as a property' },
87
+
{ height:'auto' },
88
+
{ 'before-close':event=> {} }
90
89
)
91
90
```
92
91
@@ -117,7 +116,6 @@ Vue.use(VModal, {
117
116
})
118
117
```
119
118
120
-
121
119
## Dialogs
122
120
123
121
Dialog is a simplified version of the modal which has most parameters set by default and is useful for quick prototyping, alerts, etc. Dialog is merely an example of how easy it is to create modals that fit your project needs. Nevertheless, you can use it if you set `dialog: true` in plugin configuration:
@@ -135,31 +133,30 @@ And include this component in your project:
135
133
To show modal follow this example (all params except of “text” are optional):
0 commit comments