+
+
+
+
+
setSearchTerm(e.target.value)}
+ className={styles.searchInput}
+ />
- ))
- ) : (
-
-
-
未找到匹配的资源
+
+ {filteredTotalItems}
+ {' '}
+ /
+ {totalItems}
+ {' '}
+ 项
+
- )}
+
+ {filteredGroups.length > 0
+ ? (
+ filteredGroups.map((group, groupIndex) => (
+
+
{group.groupName}
+
+ {group.items.map((item, itemIndex) => (
+
+ ))}
+
+
+ ))
+ )
+ : (
+
+ )}
+
+
+
)
-}
\ No newline at end of file
+}
diff --git a/code/docusaurus/src/components/Link/styles.module.css b/code/docusaurus/src/components/Link/styles.module.css
index 790f618e..36123f3f 100644
--- a/code/docusaurus/src/components/Link/styles.module.css
+++ b/code/docusaurus/src/components/Link/styles.module.css
@@ -1,3 +1,65 @@
+/* 容器布局 */
+.container {
+ display: flex;
+ gap: 24px;
+}
+
+.mainContent {
+ flex: 1;
+}
+
+/* 右侧导航 */
+.sidebar {
+ width: 180px;
+ flex-shrink: 0;
+ position: sticky;
+ top: 2rem;
+ height: fit-content;
+}
+
+.sidebarHeader {
+ font-size: 14px;
+ font-weight: 600;
+ color: var(--ifm-color-emphasis-600);
+ margin-bottom: 12px;
+ padding-left: 8px;
+}
+
+.sidebarLinks {
+ display: flex;
+ flex-direction: column;
+ gap: 4px;
+}
+
+.sidebarLink {
+ display: block;
+ padding: 8px 12px;
+ font-size: 14px;
+ text-align: left;
+ border: none;
+ background: transparent;
+ color: var(--ifm-color-emphasis-700);
+ border-radius: 8px;
+ cursor: pointer;
+ transition:
+ background-color 0.2s ease,
+ color 0.2s ease;
+ white-space: nowrap;
+ overflow: hidden;
+ text-overflow: ellipsis;
+}
+
+.sidebarLink:hover {
+ background-color: var(--ifm-color-emphasis-100);
+ color: var(--ifm-color-emphasis-900);
+}
+
+.sidebarLink.active {
+ background-color: var(--ifm-color-primary);
+ color: white;
+}
+
+/* 网格布局 */
.grid {
display: grid;
gap: 16px;
@@ -28,6 +90,13 @@
}
}
+/* 响应式:隐藏右侧导航 */
+@media (max-width: 1200px) {
+ .sidebar {
+ display: none;
+ }
+}
+
/* 卡片 */
.card {
@@ -194,6 +263,7 @@
.group {
margin-bottom: 32px;
+ scroll-margin-top: calc(var(--ifm-navbar-height, 64px) + 1rem);
}
.group:last-child {