File tree Expand file tree Collapse file tree 1 file changed +36
-1
lines changed
Expand file tree Collapse file tree 1 file changed +36
-1
lines changed Original file line number Diff line number Diff line change @@ -145,7 +145,7 @@ In order to instantiate modals at runtime (for lazy-loading or decluttering temp
145145To 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
151151And include the ` <modals-container/> ` component it in your project:
@@ -224,6 +224,41 @@ const app2 = new Vue({
224224VModal .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+
227262For 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.
You can’t perform that action at this time.
0 commit comments