<view style="float: right;" v-if="this.isshowGuar"> <switch style="float: right;transform:scale(0.8);" color="#722ED1" :checked="guarFlag" @change="changeGuar" /> </view>
先在switch外面添加一个边框
this.$set(this,"isshowGuar",false)//边框view消失 this.$set(this,"guarFlag",true) this.$nextTick(()=>{ setTimeout(()=>{ this.$set(this,"isshowGuar",true)//边框view重新出现 this.$forceUpdate()//强制执行 },1) })