添加(category.scss):更新页面布局样式

📝 添加(index.tsx):添加内容页面组件
📝 添加(content.scss):添加内容页面样式
📝 添加(index.tsx):添加内容页面组件
🔧 添加(router/index.tsx):更新路由配置,将内容页面添加到分类页面中
This commit is contained in:
ruotongyu
2024-06-16 09:36:26 +08:00
parent a2cdb40b3b
commit 2a65dc3343
5 changed files with 42 additions and 8 deletions

View File

@@ -3,16 +3,16 @@
display: grid;
grid-template:
"categories content" auto
"nav content" 30px/120px auto;
"nav content" 30px/100px auto;
.categories{
@apply border-r;
@apply border-r bg-slate-100 text-xs text-slate-700;
grid-area: categories;
}
.nav {
@apply border-t border-r;
@apply border-t border-r bg-slate-100 flex justify-center items-center gap-2;
grid-area: nav;
}

View File

@@ -1,11 +1,18 @@
import { Outlet } from "react-router-dom"
import "./category.scss"
import { Add, DatabaseConfig } from "@icon-park/react"
export const Category = () => {
return (
<main className="category-page">
<div className="categories">categories</div>
<div className="nav">nav</div>
<div className="content">content</div>
<div className="categories">vue.js</div>
<div className="nav">
<Add theme="outline" size="20" fill="#333"/>
<DatabaseConfig theme="outline" size="20" fill="#333"/>
</div>
<div className="content">
<Outlet></Outlet>
</div>
</main>
)
}

View File

@@ -0,0 +1,12 @@
.content-page{
@apply h-screen text-xs text-slate-700;
display: grid;
grid-template: "list content" auto / 150px auto;
.list{
@apply bg-slate-50 border-r;
grid-area: list;
}
.content{
grid-area: content;
}
}

View File

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

View File

@@ -2,6 +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";
const router = createHashRouter([
{
@@ -13,9 +14,15 @@ const router = createHashRouter([
element: <Config />,
children: [
{
path: "",
// 界面第一次打开时,默认显示的页面
index: true,
element: <Category />
element: <Category />,
children: [
{
index: true,
element: <Content />
}
]
}
]
}