版权声明:未经本人同意不得转载 一切法律责任 后果自负 https://blog.csdn.net/xy19950125/article/details/83501360
<span @click="togle">
<img :src=" this.i == 0 ? srcs : nosrc" alt="">
</span>
export default{
data(){
return{
i:0,
srcs:require('../images/[email protected]'),
nosrc:require('../images/[email protected]')
}
},
methods:{
togle(){
if(this.i==0){
this.i=1;
}else{
this.i=0;
}
}
}
}