两张图片轮流切换 img
<template>
<div id="btn">
<img id="showCont" ref="showCont" :src="this.i == 0 ? srcs : nosrc" @click="showCont()" />
</div>
</template>
<script>
export default {
data () {
return {
i:0,
srcs:require('./back.png'),
nosrc:require('./return.png'),
}
},
mounted() {
},
methods:{
showCont(){
if(this.i==0){
this.i=1;
}else{
this.i=0;
}
}
},
components: {
}
}
</script>
<style scoped lang='less'>
</style>