<span @click="togle">
<img :src=" this.i == 0 ? srcs : nosrc" alt="">
</span>
export default{
data(){
return{
i:0,
srcs:require('../images/icon-up@2x.png'),
nosrc:require('../images/icon-down@2x.png')
}
},
methods:{
togle(){
if(this.i==0){
this.i=1;
}else{
this.i=0;
}
}
}
}
轉載 http://www.51csdn.cn/article/180.html
本作品採用《CC 協議》,轉載必須註明作者和本文連結