1、
<input type="button" value="切换显示状态" @click="changeIsShow">
<img v-show="isShow" src="./img/1.jpg" alt="">
2、
data:{
isShow:false
},
methods:{
changeIsShow:function(){
this.isShow = !this.isShow;
}
}
1、
<input type="button" value="切换显示状态" @click="changeIsShow">
<img v-show="isShow" src="./img/1.jpg" alt="">
2、
data:{
isShow:false
},
methods:{
changeIsShow:function(){
this.isShow = !this.isShow;
}
}