vue图片放大缩小
//图片<div v-for="item in list"> <img @click="bigimg(item.path)" v-if="item.path!=''" :src=text1()+item.path>
//图片
<div v-for="item in list">
<img @click="bigimg(item.path)" v-if="item.path!=''" :src=text1()+item.path>
</div>
//放大
<div class="mask" v-show="bigtu" @click="small">
<img :src=image >
</div>
//return定义
image:"",
bigtu:false
//点击
bigimg(index){
this.bigtu=true;
console.log(this.text1()+index)
this.image=this.text1()+index
},
small(){
this.bigtu=false;
this.image=""
},
//样式
.mask{
position: fixed;
top: 0;
left: 0;
width: 100%;
min-height: 100%;
background: #d8d8d8;
z-index: 999;
/*opacity: .2;*/
}
.mask img{
position: absolute;
top: 1rem;
left:2.5%;
width: 95%;
height: 3.75rem;
border-radius: .05rem;
}
更多推荐
所有评论(0)