uni-app(vue3) 写Android app onBackPress
·
onBackPress((options) => {
console.log('from:' + options.from)
if (options.from === 'navigateBack') {
return false
}
if (flag.value == 'edit') {
uni.navigateBack({})
return true
} else if (flag.value == 'add') {
uni.showModal({
title: '提示',
content: `暂未保存报告单信息,请确定要继续吗?`,
success: function (res) {
if (res.confirm) {
uni.navigateBack({ delta: 2 })
} else if (res.cancel) {
}
},
})
return true
}
})
更多推荐



所有评论(0)