vue项目中实现遮罩层
<template><div id="app"><div id="mask" ref="mask" @click="mask()"><img src="..." class="mask_img"></div></div></template>mounted() {this.$refs.mask.style.heig
·
<template>
<div id="app">
<div id="mask" ref="mask" @click="mask()">
<img src="..." class="mask_img">
</div>
</div>
</template>
mounted() {
this.$refs.mask.style.height = window.document.getElementById('app').clientHeight + 'px'
},
#mask{
width: 100%;
opacity: 0.6;
background-color: black;
bottom: 0;
left: 0;
position: fixed;
z-index: 998;
}
.mask_img{
width: 316px;
height: 200px;
z-index: 999;
position: fixed;
right: 0px;
}
更多推荐
已为社区贡献1条内容
所有评论(0)