Bootstrap 实现回退历史记录关闭模态框 #261
iuroc
started this conversation in
Show and tell
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
创建模态框元素和模态框实例,设置
data-bs-backdrop
为static
不使用
data-bs-dismiss=modal
关闭模态框,改为使用history.back()
设置模态框的
shown.bs.modal
事件,定向到新的 Hash设置模态框的
hidePrevented.bs.modal
事件,执行history.back()
在需要触发模态框的 Route 的载入事件中,判断模态框元素的
display
属性,如果是block
,则关闭模态框Beta Was this translation helpful? Give feedback.
All reactions