如何处理uni-app中switch 点击事件不成立时:checked值不变
作者:互联网
<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) })
标签:set,isshowGuar,app,边框,switch,checked,true,view 来源: https://www.cnblogs.com/lp1055663105/p/16411988.html