mirror of
https://github.com/KevinMidboe/vue-js-modal.git
synced 2025-10-29 18:00:20 +00:00
add opened event and auto center height to demo: SizeModal
This commit is contained in:
@@ -1,16 +1,18 @@
|
|||||||
<template>
|
<template>
|
||||||
<modal name="size-modal"
|
<modal name="size-modal"
|
||||||
transition="nice-modal-fade"
|
transition="nice-modal-fade"
|
||||||
classes="demo-modal-class"
|
classes="demo-modal-class"
|
||||||
:min-width="200"
|
:min-width="200"
|
||||||
:min-height="200"
|
:min-height="200"
|
||||||
:pivot-y="0.25"
|
:pivot-y="0.5"
|
||||||
:adaptive="true"
|
:adaptive="true"
|
||||||
:scrollable="true"
|
:scrollable="true"
|
||||||
:reset="true"
|
:reset="true"
|
||||||
width="60%"
|
width="60%"
|
||||||
height="auto"
|
height="auto"
|
||||||
@before-open="beforeOpen"
|
@before-open="beforeOpen"
|
||||||
|
@opened="opened"
|
||||||
|
@closed="closed"
|
||||||
@before-close="beforeClose">
|
@before-close="beforeClose">
|
||||||
<div class="size-modal-content">
|
<div class="size-modal-content">
|
||||||
<div>A new paragraph will be added every 5 sec to show how <b>height</b> scales.</div>
|
<div>A new paragraph will be added every 5 sec to show how <b>height</b> scales.</div>
|
||||||
@@ -40,6 +42,15 @@
|
|||||||
clearInterval(this.timer)
|
clearInterval(this.timer)
|
||||||
this.timer = null
|
this.timer = null
|
||||||
this.paragraphs = []
|
this.paragraphs = []
|
||||||
|
},
|
||||||
|
|
||||||
|
opened (e) {
|
||||||
|
// e.ref should not be undefined here
|
||||||
|
console.log('opened', e)
|
||||||
|
},
|
||||||
|
|
||||||
|
closed (e) {
|
||||||
|
console.log('closed', e)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -59,4 +70,4 @@
|
|||||||
background: #F7F7F7;
|
background: #F7F7F7;
|
||||||
box-shadow: 5px 5px 30px 0px rgba(46,61,73, 0.6);
|
box-shadow: 5px 5px 30px 0px rgba(46,61,73, 0.6);
|
||||||
}
|
}
|
||||||
</style>
|
</style>
|
||||||
|
|||||||
Reference in New Issue
Block a user