Toggle navigation
Toggle navigation
This project
Loading...
Sign in
Hooke
/
vue-flow-editor
Go to a project
Toggle navigation
Toggle navigation pinning
Projects
Groups
Snippets
Help
Project
Activity
Repository
Pipelines
Graphs
Issues
0
Merge Requests
0
Wiki
Snippets
Network
Create a new issue
Builds
Commits
Issue Boards
Authored by
hookehuyr
2024-07-19 11:02:01 +0800
Browse Files
Options
Browse Files
Download
Email Patches
Plain Diff
Commit
ffad28cb8ad4f5fac4e2f4525775829adf0dd500
ffad28cb
1 parent
608dbedc
fix 处理iframe模式下 其他窗口可能提示刷新的问题
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
1 deletions
doc/index.vue
doc/index.vue
View file @
ffad28c
...
...
@@ -1075,13 +1075,23 @@ export default {
// 显示提示框的标志位
onMounted(async () => {
document.title = '可视化流程设计器'
localStorage.setItem('showConfirmation', '1'); // 打开刷新提示框
// TAG:打开刷新提示框
if (urlQuery.type !== 'preview') {
localStorage.setItem('showConfirmation', '1');
} else { // 预览模式下不显示刷新提示框
localStorage.setItem('showConfirmation', '0');
}
// 监听 beforeunload 事件
window.addEventListener('beforeunload', function (event) {
const confirmationMessage = "确定要离开此页面吗?您所做的更改可能不会被保存。";
if (localStorage.getItem('showConfirmation') === '1') {
// 取消事件的默认行为(弹出确认对话框)
event.preventDefault();
event.returnValue = confirmationMessage;
return confirmationMessage;
}
});
// 监听 unload 事件
window.addEventListener('unload', function () {
...
...
Please
register
or
login
to post a comment