需要强制刷新数据 this.$forceUpdate();uniapp数据更新视图不更新的问题
在switch组件外包一层父元素,把切换事件绑定在父元素身上,但是当点击时,用取消事件捕获的办法阻止switch的触发,也就是事件并不会走到子元素,当验证通过后,再更改switch的checked值<view capture-catch:tap="switchChange"> <switch checked="{{switchChecked}}" /> </view>参考【微信小程序】switch组件怎么在切换前进行验证?
风里来
最后,我终于解放了我自己……