📝 更新(ui/autoMate): 更新窗口配置,修复加载URL路径错误

📝 更新(ui/autoMate): 更新类别页面样式及路由链接
🔧 修复(ui/autoMate): 重命名content页面为contentList页面
This commit is contained in:
ruotongyu
2024-06-16 12:19:56 +08:00
parent ec56216fe1
commit 90bec306d8
6 changed files with 10 additions and 10 deletions

View File

@@ -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'
})
)
}

View File

@@ -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;
}
}

View File

@@ -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 = () => {
<main className="category-page">
<div className="categories">
{categories.map((category) => (
<div key={category.id} className="item">{category.name}</div>
<Link to={`/config/category/contentList/${category.id}`} key={category.id} className="item" >{category.name}</Link>
))}
</div>

View File

@@ -1,6 +1,6 @@
import "./content.scss"
export const Content = () => {
export const ContentList = () => {
return (<main className="content-page">
<div className="list">list</div>
<div className="content">content</div>

View File

@@ -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: <Config />,
children: [
{
path: "",
path: "category",
// 界面第一次打开时,默认显示的页面
element: <Category />,
loader: CategoryLoader,
children: [
{
index: true,
element: <Content />
path: "contentList/:cid",
element: <ContentList />
}
]
}