app返回提示:是否保存编辑信息
表单内容过多时,用户编辑表单,编辑到一半,返回时询问保存编辑信息,保存后下次进来自动填写保存的表单内容。
onBackPress(e) {
const that = this;
if (e.from == "backbutton") {
if (!that.isEdit) {
uni.showModal({
title: "提示",
content: "是否保留此次编辑?",
success(res) {
if (res.confirm) {
// 保存编辑(执行创建数据缓存的方法)
that.createDataStorageSync()
uni.navigateBack()
} else {
uni.navigateBack()
}
}
})
} else {
uni.navigateBack()
}
return true; //阻止默认返回行为
}
},
977条评论
wabgame.xyz
hi!,I really like your writing very so much! proportion we be in contact extra approximately
your post on AOL? I require a specialist in this area to solve my problem.
Maybe that’s you! Taking a look forward to look you.
zotgamers.xyz
I know this web page provides quality based posts and other data,
is there any other site which presents such things in quality?