const confirmExit = (e) => {
let dialogText = 'You have unsaved changes. If you leave this page all changes will be lost. Do you wish to continue?';
e.returnValue = dialogText;
return dialogText;
}
window.onbeforeunload = confirmExit;
用户确认重新加载选项后如何添加条件以便我可以路由到应用程序的根页面?
用户确认刷新按钮后:http://localhost:9000/