79 lines
1.9 KiB
Vue
Executable File
79 lines
1.9 KiB
Vue
Executable File
<template>
|
|
<view :style="popupContainerStyleReactive">
|
|
<opsoft-mask v-on="$listeners" v-bind="$attrs"/>
|
|
<view class="opsoft-screen-popup" :style="popupStyleReactive" @tap.stop="popupScreenClick">
|
|
<slot name="popupContent"/>
|
|
</view>
|
|
</view>
|
|
</template>
|
|
|
|
<script>
|
|
import {ref, computed} from "vue";
|
|
export default {
|
|
name: "opsoft-screen-popup",
|
|
props: {
|
|
popupStyle: { type: Object, default: () => ({})},
|
|
popupContainerStyle: { type: Object, default: () => ({})},
|
|
},
|
|
watch: {
|
|
popupStyle: {
|
|
deep: true,
|
|
handler: function (newValue, OldValue) {
|
|
if (newValue) {
|
|
let obj = new Object();
|
|
Object.assign(obj, this.popupStyleReactive);
|
|
Object.assign(obj, newValue);
|
|
this.popupStyleReactive = obj;
|
|
}
|
|
}
|
|
},
|
|
popupContainerStyle: {
|
|
deep: true,
|
|
handler: function (newValue, OldValue) {
|
|
if (newValue) {
|
|
let obj = new Object();
|
|
Object.assign(obj, this.popupContainerStyleReactive);
|
|
Object.assign(obj, newValue);
|
|
this.popupContainerStyleReactive = obj;
|
|
}
|
|
}
|
|
},
|
|
},
|
|
data() {
|
|
return {
|
|
popupStyleReactive: new Object(),
|
|
popupContainerStyleReactive: new Object(),
|
|
}
|
|
},
|
|
created() {
|
|
if (this.popupStyle) {
|
|
let obj = new Object();
|
|
Object.assign(obj, this.popupStyleReactive);
|
|
Object.assign(obj, this.popupStyle);
|
|
this.popupStyleReactive = obj;
|
|
}
|
|
|
|
if (this.popupContainerStyle) {
|
|
let obj = new Object();
|
|
Object.assign(obj, this.popupContainerStyleReactive);
|
|
Object.assign(obj, this.popupContainerStyle);
|
|
this.popupContainerStyleReactive = obj;
|
|
}
|
|
},
|
|
methods: {
|
|
popupScreenClick: function(event){
|
|
this.$emit("popupScreenClick", event)
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style>
|
|
.opsoft-screen-popup{
|
|
z-index: 999;
|
|
display: flex;
|
|
flex-direction: column;
|
|
align-items: center;
|
|
}
|
|
</style>
|