Skip to content

Commit 507c2fe

Browse files
committed
Merge branch 'master' of github.com:euvl/vue-js-modal
2 parents f093d1e + c7372a7 commit 507c2fe

File tree

1 file changed

+36
-1
lines changed

1 file changed

+36
-1
lines changed

README.md

Lines changed: 36 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ In order to instantiate modals at runtime (for lazy-loading or decluttering temp
145145
To start using this feature you must set `dynamic: true` in plugin configuration:
146146

147147
```js
148-
Vue.use(VModal, { dynamic: true })
148+
Vue.use(VModal, { dynamic: true, dynamicDefaults: { clickToClose: false } })
149149
```
150150

151151
And include the `<modals-container/>` component it in your project:
@@ -224,6 +224,41 @@ const app2 = new Vue({
224224
VModal.rootInstance = app2
225225
```
226226

227+
It is possible to set default property values for dynamic modals.
228+
229+
Example:
230+
231+
```javascript
232+
233+
import VueJsModal from 'plugin'
234+
235+
Vue.use(VueJsModal, {
236+
dynamic: true,
237+
dynamicDefaults: {
238+
foo: 'foo'
239+
}
240+
})
241+
```
242+
243+
```javascript
244+
{
245+
showDynamicRuntimeModal () {
246+
this.$modal.show({
247+
template: `
248+
<div class="example-modal-content">
249+
<p>{{ text }}</p>
250+
<p>Default Property: {{ foo }} - value is "foo"</p>
251+
</div>
252+
`,
253+
props: ['text', 'foo']
254+
}, {
255+
text: 'This text is passed as a property'
256+
})
257+
},
258+
}
259+
```
260+
261+
227262
For more examples please take a look at [vue-js-modal.yev.io](http://vue-js-modal.yev.io).
228263

229264
**Note:** keep in mind that there are some limitations in using dynamic modals. If you need full functionality then use ordinary modal instead.

0 commit comments

Comments
 (0)