[Improvement] uniform fade animation (#410)
This commit is contained in:
@@ -1,11 +1,14 @@
|
||||
<template>
|
||||
<div
|
||||
class="van-modal"
|
||||
:class="className"
|
||||
:style="style"
|
||||
@touchmove.prevent.stop
|
||||
@click="$emit('click', $event)"
|
||||
/>
|
||||
<transition name="van-fade">
|
||||
<div
|
||||
v-show="visible"
|
||||
class="van-modal"
|
||||
:class="className"
|
||||
:style="style"
|
||||
@touchmove.prevent.stop
|
||||
@click="$emit('click', $event)"
|
||||
/>
|
||||
</transition>
|
||||
</template>
|
||||
|
||||
<script>
|
||||
@@ -13,6 +16,7 @@ export default {
|
||||
name: 'van-modal',
|
||||
|
||||
props: {
|
||||
visible: Boolean,
|
||||
zIndex: Number,
|
||||
className: String,
|
||||
customStyle: Object
|
||||
|
||||
@@ -66,7 +66,7 @@ const PopupManager = {
|
||||
const el = modal.$el;
|
||||
|
||||
if (el.parentNode) {
|
||||
el.parentNode.removeChild(el);
|
||||
modal.visible = false;
|
||||
}
|
||||
|
||||
if (context.top) {
|
||||
@@ -75,7 +75,8 @@ const PopupManager = {
|
||||
targetNode.appendChild(el);
|
||||
Object.assign(modal, {
|
||||
...modalDefaultConfig,
|
||||
...config
|
||||
...config,
|
||||
visible: true
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user