77 lines
2.1 KiB
Vue
Executable File
77 lines
2.1 KiB
Vue
Executable File
<template>
|
|
<opsoft-screen-popup :maskShow="true" :popupStyle="popupStyleReactive" :maskBackgroundColor="maskBackgroundColor"
|
|
:popupContainerStyle="popupContainerStyleReactive" v-bind="$attrs" v-on="$listeners">
|
|
<template v-slot:popupContent>
|
|
<slot />
|
|
</template>
|
|
</opsoft-screen-popup>
|
|
</template>
|
|
|
|
<script>
|
|
export default {
|
|
name: "opsoft-center-popup",
|
|
props: {
|
|
popupStyle: { type: Object, default: () => ({})},
|
|
popuContentStyle: { type: Object, default: () => ({})},
|
|
maskBackgroundColor: {type: String, default: ''}
|
|
},
|
|
data(){
|
|
return {
|
|
popupStyleReactive: new Object(),
|
|
popuContentStyleReactive: new Object(),
|
|
popupContainerStyleReactive: {
|
|
position: 'fixed',
|
|
zIndex: 999,
|
|
display: 'flex',
|
|
flexDirection: 'column',
|
|
alignItems: 'center',
|
|
justifyContent: 'center',
|
|
width: '100%',
|
|
height: '100%',
|
|
top: '0px',
|
|
left: '0px'
|
|
}
|
|
}
|
|
},
|
|
watch:{
|
|
popupStyle: {
|
|
handle:function(newValue, oldValue) {
|
|
if (newValue) {
|
|
let obj = new Object();
|
|
Object.assign(obj, this.popupStyleReactive);
|
|
Object.assign(obj, newValue);
|
|
this.popupStyleReactive = obj;
|
|
}
|
|
},
|
|
deep: true
|
|
},
|
|
popuContentStyle: {
|
|
handle:function(newValue, oldValue) {
|
|
if (newValue) {
|
|
let obj = new Object();
|
|
Object.assign(obj, this.popuContentStyleReactive);
|
|
Object.assign(obj, newValue);
|
|
this.popuContentStyleReactive = obj;
|
|
}
|
|
},
|
|
deep: true
|
|
}
|
|
},
|
|
created() {
|
|
this.popupStyleReactive = new Object();
|
|
this.popupStyleReactive.width = '622rpx';
|
|
this.popupStyleReactive.height = '480rpx';
|
|
this.popupStyleReactive.background = 'rgba(255, 255, 255, 1)';
|
|
this.popupStyleReactive.boxShadow = '0px 1px 9px rgba(209, 209, 209, 0.5)';
|
|
this.popupStyleReactive.borderRadius = '12px';
|
|
this.popupStyleReactive.display = 'flex';
|
|
this.popupStyleReactive.flexdirection = 'column';
|
|
if (this.popupStyle) {
|
|
Object.assign(this.popupStyleReactive, this.popupStyle);
|
|
}
|
|
}
|
|
}
|
|
</script>
|
|
|
|
<style lang="scss">
|
|
</style> |