lv 2 долоо хоног өмнө
parent
commit
c96f2c010a
1 өөрчлөгдсөн 11 нэмэгдсэн , 3 устгасан
  1. 11 3
      src/App.tsx

+ 11 - 3
src/App.tsx

@@ -723,6 +723,14 @@ function App() {
       console.error("appWindow.minimize 失败:", e);
     }
   }, [appWindow]);
+
+  const handleBack = useCallback(() => {
+    invoke("webview_history_action", { action: "back" });
+  }, []);
+
+  const handleRefresh = useCallback(() => {
+    invoke("webview_history_action", { action: "reload" });
+  }, []);
   return (
     <Layout className="m-0 p-0 h-full overflow-hidden">
       {/* data-tauri-drag-region:Tauri 2 原生支持,webview 层会自动 hook mousedown
@@ -757,14 +765,14 @@ function App() {
             // size="large"
             type="text"
             data-tauri-drag-region="no-drag"
-          // onClick={handleBack}
+            onClick={handleBack}
           />
           <Button
             icon={<RedoOutlined />}
             // size="large"
             type="text"
             data-tauri-drag-region="no-drag"
-          // onClick={handleRefresh}
+            onClick={handleRefresh}
           />
 
           <Tooltip
@@ -936,7 +944,7 @@ function App() {
       <Layout>
         <Sider className="select-none" collapsible collapsed={collapsed} onCollapse={(c) => handleCollaspsed(c)} width={180} style={{ background: colorBgContainer }}>
           <div className="h-full w-full flex-row">
-            <div className="flex justify-between items-center text-md pl-4 font-bold text-white"><OrderedListOutlined />{collapsed ? '' : '所有任务'}<Button icon={<PlusOutlined />} onClick={openImportWindow} /> </div>
+            <div className="flex justify-between items-center text-md pl-3 font-bold text-white"><OrderedListOutlined />{collapsed ? '' : '所有任务'}<Button icon={<PlusOutlined />} onClick={openImportWindow} /> </div>
             <div className="flex-1 overflow-y-auto">
               <Menu
                 mode="vertical"