利用 onBackPress 处理 注意:需要 return true 阻止默认事件,否则会有提示 再滑一次退出应用 import { onBackPress } from '@dcloudio/uni-app' // 截获左滑右滑 onBackPress(() => { if (modalVisible.value == true) { modalVisible.value = false // 阻止默认事件 return true } })