Skip to content

我想使用h5, 禁止原生返回,并且弹出弹窗问他返回将不能交易, 他点击确认在给他返回,我使用的是 window.history.pushState(null, null, document.URL); window.addEventListener('popstate', this.webGoBack),但是现在的问题是两个相同的路由返回他会重新执行生命周期(以前并不会)。如果大家有啥别的好方法也可以告诉我 #13844

Closed Unanswered
youngpj asked this question in Q & A
Discussion options

You must be logged in to vote

Replies: 3 comments 5 replies

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
1 reply
@youngpj
Comment options

Comment options

You must be logged in to vote
4 replies
@youngpj
Comment options

@ZakaryCode
Comment options

@youngpj
Comment options

@ZakaryCode
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q & A
Labels
A-router Area - H5 路由相关 V-3 Version - 3.x F-react Framework - React T-h5 Target - 编译到 H5
3 participants
Converted from issue

This discussion was converted from issue #13843 on May 15, 2023 02:16.