[improvement] move overlay component (#2192)

This commit is contained in:
neverland
2018-11-30 16:40:50 +08:00
committed by GitHub
parent 996c67b4fc
commit 89ff50944c
11 changed files with 40 additions and 18 deletions
-34
View File
@@ -1,34 +0,0 @@
<template>
<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>
export default {
name: 'modal',
props: {
zIndex: Number,
visible: Boolean,
className: String,
customStyle: Object
},
computed: {
style() {
return {
zIndex: this.zIndex,
...this.customStyle
};
}
}
};
</script>
+2 -2
View File
@@ -1,6 +1,6 @@
import Vue from 'vue';
import Modal from './Modal';
import context from './context';
import Overlay from '../../overlay';
const defaultConfig = {
className: '',
@@ -35,7 +35,7 @@ export default {
let { modal } = context;
if (!modal) {
modal = new (Vue.extend(Modal))({
modal = new (Vue.extend(Overlay))({
el: document.createElement('div')
});
modal.$on('click', this.onClick);