[Improvement] uniform fade animation (#410)

This commit is contained in:
neverland
2017-12-11 20:00:26 +08:00
committed by GitHub
parent 49ef814d1e
commit 7dbb5db256
8 changed files with 36 additions and 25 deletions
+11 -7
View File
@@ -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
+3 -2
View File
@@ -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
});
}
}