From bd7c4ed4cdfe238d8941b340c4b300f4b7bf96d8 Mon Sep 17 00:00:00 2001 From: Vixalie Date: Tue, 22 Jul 2025 14:45:50 +0800 Subject: [PATCH] =?UTF-8?q?feat(router):=20=E6=B7=BB=E5=8A=A0=E5=B8=83?= =?UTF-8?q?=E5=B1=80=E7=BB=84=E4=BB=B6=E5=B9=B6=E9=9B=86=E6=88=90=E5=88=B0?= =?UTF-8?q?=E8=B7=AF=E7=94=B1=E4=B8=AD?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 新增 Layout 组件作为应用的主布局结构,包含导航栏和窗口拖拽区域 将 Layout 设置为路由的根组件,统一管理页面布局结构 --- src/Layout.tsx | 67 ++++++++++++++++++++++++++++++++++++++++++++++++++ src/index.tsx | 3 ++- 2 files changed, 69 insertions(+), 1 deletion(-) create mode 100644 src/Layout.tsx diff --git a/src/Layout.tsx b/src/Layout.tsx new file mode 100644 index 0000000..fae8e2c --- /dev/null +++ b/src/Layout.tsx @@ -0,0 +1,67 @@ +import { Icon } from '@iconify-icon/solid'; +import { A } from '@solidjs/router'; +import { Component, ParentComponent } from 'solid-js'; +import { Portal } from 'solid-js/web'; + +const WindowDragHandle: Component = () => { + return ( + +
+ + ); +}; + +interface NavigationLinkProps { + href: string; +} + +const NavigateLink: ParentComponent = (props) => { + return ( + +
{props.children}
+
+ ); +}; + +const Layout: ParentComponent = (props) => { + return ( +
+
+ ComfyUI Resources +
+
+
+ +
{props.children}
+
+ +
+ ); +}; + +export default Layout; diff --git a/src/index.tsx b/src/index.tsx index 6f34038..cdd9613 100644 --- a/src/index.tsx +++ b/src/index.tsx @@ -5,5 +5,6 @@ import './index.css'; // Load components. import { Router } from '@solidjs/router'; import { render } from 'solid-js/web'; +import Layout from './Layout'; -render(() => , document.getElementById('root') as HTMLElement); +render(() => , document.getElementById('root') as HTMLElement);