<template>
<div>
<div id="mask" v-show="isPay">
<div class="mask_img"></div>
</div>
<button @click="mask()">11111</button>
</div>
</template>
<style scoped>
#mask {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0, 0, 0, 0.3);
}
.mask_img {
background: yellow;
width: 316px;
height: 200px;
z-index: 999;
position: fixed;
right: 0px;
}
</style>
<script>
export default {
data() {
return {
isPay: false
};
},
methods: {
mask() {
this.isPay = !this.isPay;
}
}
};
</script>