🐛 修复(ui/autoMate):修复渲染器页面初始加载问题

📝 文档(ui/autoMate):更新搜索框样式和占位符文本
  ♻️ 重构(ui/autoMate):重新组织和调整路由结构
This commit is contained in:
yuruo
2024-06-18 17:21:49 +08:00
parent 754939aec4
commit 4bdc286f1f
3 changed files with 13 additions and 6 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/category")
win.loadURL(process.env['ELECTRON_RENDERER_URL'] + "/#config/category/contentList")
} else {
win.loadURL(
url.format({
pathname: join(__dirname, '../renderer/index.html'),
protocol: 'file',
slashes: true,
hash: 'config/category'
hash: 'config/category/contentList'
})
)
}

View File

@@ -6,6 +6,13 @@ export const ContentList = () => {
const contentList = useLoaderData() as ContentType[]
return (<main className="contentList-page">
<div className="list">
<input
type="text"
placeholder="搜索..."
className="outline-none text-sm font-bold py-2 px-3 border-b
w-full"
/>
{contentList.map(content => (
<NavLink
key={content.id}

View File

@@ -25,15 +25,15 @@ const router = createHashRouter([
element: <Category />,
loader: CategoryLoader,
children: [
{
index: true,
element: <Welcome />
},
{
path: "contentList/:cid?",
loader: ContentListLoader,
element: <ContentList />,
children: [
{
index: true,
element: <Welcome />
},
{
path: "content/:id",
loader: ContentLoader,