mirror of
https://github.com/youzan/vant.git
synced 2026-05-05 01:00:55 +08:00
[improvement] move overlay component (#2192)
This commit is contained in:
@@ -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>
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user