mirror of
https://github.com/yuruotong1/autoMate.git
synced 2025-12-26 05:16:21 +08:00
🔧 修复(tables.ts):注释掉不需要的contents表创建语句
📝 更新(Content.tsx):更新内容页的输入UI 📝 更新(content.scss):更新内容页样式 📝 更新(contentList.scss):更新内容列表页样式
This commit is contained in:
parent
5bdffb0f17
commit
f0953c4a8b
@ -10,15 +10,15 @@ CREATE TABLE IF NOT EXISTS categories (
|
||||
`)
|
||||
|
||||
|
||||
db.exec(`
|
||||
CREATE TABLE IF NOT EXISTS contents (
|
||||
id INTEGER PRIMARY KEY AUTOINCREMENT not null,
|
||||
title TEXT not null,
|
||||
content TEXT not null,
|
||||
category_id INTEGER,
|
||||
created_at TEXT not null
|
||||
);
|
||||
`)
|
||||
// db.exec(`
|
||||
// CREATE TABLE IF NOT EXISTS contents (
|
||||
// id INTEGER PRIMARY KEY AUTOINCREMENT not null,
|
||||
// title TEXT not null,
|
||||
// content TEXT not null,
|
||||
// category_id INTEGER,
|
||||
// created_at TEXT not null
|
||||
// );
|
||||
// `)
|
||||
|
||||
// for (let i = 0; i < 20; i++) {
|
||||
// const name = Random.title(5, 10)
|
||||
|
||||
@ -1,11 +1,15 @@
|
||||
import { useLoaderData } from "react-router-dom"
|
||||
import "./content.scss"
|
||||
import { Button } from "antd"
|
||||
export const Content = () => {
|
||||
const content = useLoaderData() as ContentType
|
||||
return (
|
||||
<main className="content-page">
|
||||
<h1>{content.title}</h1>
|
||||
<div className="content">{content.content}</div>
|
||||
<input defaultValue={content.title}/>
|
||||
<textarea defaultValue={content.content}/>
|
||||
<div className="border-t flex items-center justify-center">
|
||||
<Button type="default" size="small">保存</Button>
|
||||
</div>
|
||||
</main>
|
||||
)
|
||||
}
|
||||
@ -1,10 +1,12 @@
|
||||
.content-page{
|
||||
@apply p-3;
|
||||
h1{
|
||||
@apply text-base font-bold text-slate-600 opacity-95;
|
||||
@apply h-screen;
|
||||
display: grid;
|
||||
grid-template-rows: 50px 1fr 40px;
|
||||
input{
|
||||
@apply text-lg outline-none bg-slate-50 p-3;
|
||||
}
|
||||
|
||||
.content{
|
||||
@apply text-sm text-slate-500 opacity-95 leading-relaxed;
|
||||
textarea{
|
||||
@apply border-t pt-5 outline-none text-sm opacity-90 bg-slate-50 p-3;
|
||||
}
|
||||
}
|
||||
@ -3,7 +3,7 @@
|
||||
display: grid;
|
||||
grid-template: "list content" auto / 150px auto;
|
||||
.list{
|
||||
@apply bg-slate-50 border-r overflow-y-auto;
|
||||
@apply border-r overflow-y-auto;
|
||||
grid-area: list;
|
||||
a {
|
||||
@apply truncate py-1 px-1 cursor-pointer flex items-center gap-1 border-b mx-2;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user