<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

Logo

前往低代码交流专区

更多推荐