mirror of
https://github.com/yuruotong1/autoMate.git
synced 2026-03-22 13:07:17 +08:00
🐛 修复(ui/autoMate):修复渲染器页面初始加载问题
📝 文档(ui/autoMate):更新搜索框样式和占位符文本 ♻️ 重构(ui/autoMate):重新组织和调整路由结构
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/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'
|
||||
})
|
||||
)
|
||||
}
|
||||
|
||||
@@ -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}
|
||||
|
||||
@@ -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,
|
||||
|
||||
Reference in New Issue
Block a user