app端在nvue页面,使用uni-popup组件时,uni-popup里面的点击事件,第一次打开与关闭事件正常,第二次打开组件内绑定的所有事件失效。
个人感觉是因为事件绑定失效导致的,不知道uni-app什么时候能解决,目前我们可以用v-if
重新渲染这个部分来间接重新绑定一下事件。
<uni-popup ref="popupAgreement" type="center" :is-mask-click="false">
<div class="popup_inner">
<div class="popup_btns" v-if="dialog_open">
<button class="popup_btn cancel" @click="refuse"> <text class="btn_text">不同意</text> </button>
<button class="popup_btn popup_btn_confirm" @click="confirm_popup"> <text class="btn_text">同意</text> </button>
</div>
</div>
</uni-popup>
/**打开隐私权限弹窗*/
open_dialog() {
this.dialog_open = true
this.$refs.popupAgreement.open('center')
},
/**关闭dialog* */
closePopup() {
this.dialog_open = false
this.$refs.popupAgreement.close()
},