diff --git a/ui/autoMate/src/main/config/window.ts b/ui/autoMate/src/main/config/window.ts index 7a6869b..190a85c 100644 --- a/ui/autoMate/src/main/config/window.ts +++ b/ui/autoMate/src/main/config/window.ts @@ -35,14 +35,14 @@ export function createWindow(): BrowserWindow { // Create the browser window. // HMR for renderer base on electron-vite cli. // Load the remote URL for development or the local html file for production. if (is.dev && process.env['ELECTRON_RENDERER_URL']) { - win.loadURL(process.env['ELECTRON_RENDERER_URL'] + "/#config") + win.loadURL(process.env['ELECTRON_RENDERER_URL'] + "/#config/category") } else { win.loadURL( url.format({ pathname: join(__dirname, '../renderer/index.html'), protocol: 'file', slashes: true, - hash: 'config' + hash: 'config/category' }) ) } diff --git a/ui/autoMate/src/renderer/src/pages/Category/category.scss b/ui/autoMate/src/renderer/src/pages/Category/category.scss index 5ef1be2..85f368e 100644 --- a/ui/autoMate/src/renderer/src/pages/Category/category.scss +++ b/ui/autoMate/src/renderer/src/pages/Category/category.scss @@ -10,7 +10,7 @@ @apply border-r bg-slate-100 text-xs text-slate-700 overflow-y-auto; grid-area: categories; .item{ - @apply p-1 py-1 truncate cursor-pointer; + @apply p-1 py-1 truncate cursor-pointer block; } } diff --git a/ui/autoMate/src/renderer/src/pages/Category/index.tsx b/ui/autoMate/src/renderer/src/pages/Category/index.tsx index 42265ce..a035de9 100644 --- a/ui/autoMate/src/renderer/src/pages/Category/index.tsx +++ b/ui/autoMate/src/renderer/src/pages/Category/index.tsx @@ -1,4 +1,4 @@ -import { Outlet, useLoaderData } from "react-router-dom" +import { Link, Outlet, useLoaderData } from "react-router-dom" import "./category.scss" import { Add, DatabaseConfig } from "@icon-park/react" @@ -8,7 +8,7 @@ export const Category = () => {
{categories.map((category) => ( -
{category.name}
+ {category.name} ))}
diff --git a/ui/autoMate/src/renderer/src/pages/Content/content.scss b/ui/autoMate/src/renderer/src/pages/ContentList/content.scss similarity index 100% rename from ui/autoMate/src/renderer/src/pages/Content/content.scss rename to ui/autoMate/src/renderer/src/pages/ContentList/content.scss diff --git a/ui/autoMate/src/renderer/src/pages/Content/index.tsx b/ui/autoMate/src/renderer/src/pages/ContentList/index.tsx similarity index 83% rename from ui/autoMate/src/renderer/src/pages/Content/index.tsx rename to ui/autoMate/src/renderer/src/pages/ContentList/index.tsx index c2cab8b..78d7bdd 100644 --- a/ui/autoMate/src/renderer/src/pages/Content/index.tsx +++ b/ui/autoMate/src/renderer/src/pages/ContentList/index.tsx @@ -1,6 +1,6 @@ import "./content.scss" -export const Content = () => { +export const ContentList = () => { return (
list
content
diff --git a/ui/autoMate/src/renderer/src/router/index.tsx b/ui/autoMate/src/renderer/src/router/index.tsx index 32e7ee5..5c0bed0 100644 --- a/ui/autoMate/src/renderer/src/router/index.tsx +++ b/ui/autoMate/src/renderer/src/router/index.tsx @@ -2,7 +2,7 @@ import Config from "@renderer/pages/Config"; import Home from "@renderer/pages/Home"; import { createHashRouter } from "react-router-dom"; import {Category} from "@renderer/pages/Category"; -import { Content } from "@renderer/pages/Content"; +import { ContentList } from "@renderer/pages/ContentList"; import CategoryLoader from "@renderer/pages/Category/CategoryLoader"; const router = createHashRouter([ @@ -15,14 +15,14 @@ const router = createHashRouter([ element: , children: [ { - path: "", + path: "category", // 界面第一次打开时,默认显示的页面 element: , loader: CategoryLoader, children: [ { - index: true, - element: + path: "contentList/:cid", + element: } ] }