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; //阻止默认返回行为
}
},
815条评论
Pingback:
Hedy Maclellan
Why users still use to read news papers when in this technological world all is accessible on net?|
Glen Woitowitz
Piece of writing writing is also a fun, if you be familiar with then you can write otherwise it is complicated to write.|
bitcoin casinos
Hello it’s me, I am also visiting this web site on a regular basis, this web site is really fastidious and the visitors are actually sharing
good thoughts.
https://bitcoinnettikasinot.xyz/
Its like you read my mind! You appear to know a lot about this, like you
wrote the book in it or something. I think that you could do
with a few pics to drive the message home a little bit, but instead of that, this
is wonderful blog. A great read. I will definitely be back.