@@ -206,52 +206,68 @@ export default {
206206 this .$modal .show (
207207 {
208208 template: `
209- <div class="example-modal-content">
210- <h1>This is created inline</h1>
211- <p>{{ text }}</p>
212- <p>Default Property: {{ foo }}</p>
213- </div>
214- ` ,
215- props: [' text' , ' foo ' ]
209+ <div class="example-modal-content">
210+ <h1>This is created inline</h1>
211+ <p>{{ text }}</p>
212+ <p>Default Property: {{ foo }}</p>
213+ </div>
214+ ` ,
215+ props: [' text' , ' height ' ]
216216 },
217217 {
218- text: ' This text is passed as a property'
218+ text: ' This text is passed as a property' ,
219+ height: ' auto'
219220 }
220221 )
221222 },
222223
223224 showDynamicComponentModal () {
225+ console .log (' Showing one more' )
224226 this .$modal .show (DemoCustomComponent, {
225227 text: ' This text is passed as a property'
226228 })
227229 },
228230
229231 showDynamicComponentModalWithModalParams () {
230- this .$modal .show (
231- {
232- template: `
233- <div class="example-modal-content">
234- <button class="btn" @click="closeByName">Close this using name</button>
235- <button class="btn" @click="closeByEvent">Close this using events</button>
236- </div>
237- ` ,
238- methods: {
239- closeByName () {
240- this .$modal .hide (' dynamic-modal' )
241- },
242- closeByEvent () {
243- this .$emit (' close' )
232+ let counter = 0
233+
234+ const interval = setInterval (() => {
235+ if (counter === 5 ) {
236+ clearInterval (interval)
237+ } else {
238+ counter++
239+ }
240+
241+ const name = ` dynamic-modal-${ Date .now ()} `
242+
243+ this .$modal .show (
244+ {
245+ template: `
246+ <div class="example-modal-content">
247+ <button class="btn" @click="closeByName">Close this using name</button>
248+ <button class="btn" @click="closeByEvent">Close this using events</button>
249+ <button class="btn" @click="this.$modal.hideAll">Close all dynamic modals</button>
250+ </div>
251+ ` ,
252+ methods: {
253+ closeByName () {
254+ this .$modal .hide (name)
255+ },
256+ closeByEvent () {
257+ this .$emit (' close' )
258+ }
244259 }
260+ },
261+ null ,
262+ {
263+ height: ' auto' ,
264+ name: name,
265+ resizable: true ,
266+ adaptive: true ,
267+ draggable: true
245268 }
246- },
247- null ,
248- {
249- name: ' dynamic-modal' ,
250- resizable: true ,
251- adaptive: true ,
252- draggable: true
253- }
254- )
269+ )
270+ }, 2000 )
255271 },
256272
257273 dialogEvent (eventName ) {
0 commit comments