mirror of
https://github.com/yuruotong1/autoMate.git
synced 2026-03-22 13:07:17 +08:00
📝 更新(ui/autoMate): 更新窗口配置,修复加载URL路径错误
📝 更新(ui/autoMate): 更新类别页面样式及路由链接 🔧 修复(ui/autoMate): 重命名content页面为contentList页面
This commit is contained in:
@@ -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'
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
@@ -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;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -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>
|
||||
|
||||
|
||||
@@ -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>
|
||||
@@ -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 />
|
||||
}
|
||||
]
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user