[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
+10
View File
@@ -0,0 +1,10 @@
@import '../style/var';
.van-overlay {
position: fixed;
top: 0;
left: 0;
width: 100%;
height: 100%;
background-color: @overlay-background-color;
}
+34
View File
@@ -0,0 +1,34 @@
<template>
<transition name="van-fade">
<div
v-show="visible"
class="van-overlay"
:class="className"
:style="style"
@touchmove.prevent.stop
@click="$emit('click', $event)"
/>
</transition>
</template>
<script>
export default {
name: 'overlay',
props: {
zIndex: Number,
visible: Boolean,
className: String,
customStyle: Object
},
computed: {
style() {
return {
zIndex: this.zIndex,
...this.customStyle
};
}
}
};
</script>