Skip to content

Commit 2120192

Browse files
添加离开页面提示
1 parent ffd4ba0 commit 2120192

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

src/main.tsx

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,5 +15,10 @@ createRoot(document.getElementById("root")!).render(
1515
</TypstInitStatusProvider>
1616
</AntApp>
1717
</ConfigProvider>
18-
</StrictMode>,
18+
</StrictMode>
1919
);
20+
21+
if (import.meta.env.MODE !== "development")
22+
window.addEventListener("beforeunload", (e) => {
23+
e.preventDefault();
24+
});

0 commit comments

Comments
 (0)