Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

想知道这个支持路由拦截么,我这边想做个h5表单页离开当前页提示未保存,确定返回么? #13

Open
helong123445 opened this issue Jul 24, 2024 · 1 comment

Comments

@helong123445
Copy link

这个功能解决了什么问题?

可以更好操作页面

你期望的 API 是什么样子的?

beforeRouteLeave

@SuHeran
Copy link

SuHeran commented Oct 16, 2024

uniapp 自带onBackPress方法就能实现你说的场景
onBackPress(e) { //backbutton 是点击物理按键返回,navigateBack是uniapp中的返回(比如左上角的返回箭头) if(e.from === 'backbutton') { this.cancel() return true // 阻止返回 } console.log(e); }

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants