Files
dashboard/.qoder/repowiki/zh/content/前端组件/业务组件/标签页视图组件.md
T

379 lines
18 KiB
Markdown
Raw Normal View History

2026-06-30 14:46:52 +08:00
# 标签页视图组件
<cite>
**本文引用的文件**
- [TabsView.vue](file://frontend/src/components/TabsView.vue)
- [tabs.js](file://frontend/src/utils/tabs.js)
- [index.js](file://frontend/src/router/index.js)
- [index.vue](file://frontend/src/layout/index.vue)
- [lux-theme.css](file://frontend/src/styles/lux-theme.css)
2026-07-14 18:56:13 +08:00
- [index.vue](file://frontend/src/views/toolbox/luxsin-controller/index.vue)
2026-06-30 14:46:52 +08:00
</cite>
2026-07-10 16:51:05 +08:00
## 更新摘要
**所做更改**
- **现代化设计系统**:采用固定内边距策略,解决标签页悬停时的布局抖动问题
- **一致的关闭按钮尺寸**:统一关闭按钮为14x14px,提供稳定的视觉体验
- **改进的层级管理**:优化活动标签和悬停状态的z-index管理,确保正确的视觉层次
- **增强的视觉反馈**:通过内嵌阴影提升交互反馈效果,改善用户体验
- **平滑过渡动画**:添加0.2s颜色过渡动画,提供更流畅的交互体验
- **玻璃拟态设计支持**:集成现代玻璃质感视觉效果
2026-07-10 16:51:05 +08:00
2026-06-30 14:46:52 +08:00
## 目录
1. [简介](#简介)
2. [项目结构](#项目结构)
3. [核心组件](#核心组件)
4. [架构总览](#架构总览)
5. [详细组件分析](#详细组件分析)
6. [依赖关系分析](#依赖关系分析)
7. [性能考量](#性能考量)
8. [故障排查指南](#故障排查指南)
9. [结论](#结论)
10. [附录](#附录)
## 简介
本文件为标签页视图组件的综合技术文档,聚焦于标签页的状态管理、数据结构设计、事件处理系统、生命周期管理、主题与图标配置以及与路由系统的集成与状态同步机制。该组件基于 Vue 3 Composition API 与 Element Plus Tabs 实现,支持标签页的激活、关闭、右键菜单操作、持久化存储,并通过 KeepAlive 实现组件缓存与内存优化。**最新更新**:实现了现代化的标签页设计系统,包括固定内边距策略、一致的关闭按钮尺寸、改进的层级管理和增强的视觉反馈效果。
2026-06-30 14:46:52 +08:00
## 项目结构
标签页视图组件位于前端工程的组件目录中,与路由、布局及主题样式协同工作:
- 组件层:标签页视图组件负责标签集合的渲染、状态管理与事件处理
- 工具层:标签页常量与持久化工具函数
- 路由层:定义页面路由与元信息,驱动标签页标题与图标
- 布局层:承载标签页视图组件并提供面包屑导航与用户菜单
2026-07-10 16:51:05 +08:00
- 样式层:深色主题与标签页视觉样式,包含玻璃拟态设计系统
2026-07-14 18:56:13 +08:00
- 视图层:工具箱功能页面,提供设备控制和管理工具
2026-06-30 14:46:52 +08:00
```mermaid
graph TB
subgraph "前端应用"
L["Layout 布局<br/>index.vue"]
TV["标签页视图组件<br/>TabsView.vue"]
R["路由配置<br/>router/index.js"]
T["标签页工具<br/>utils/tabs.js"]
ST["主题样式<br/>styles/lux-theme.css"]
2026-07-14 18:56:13 +08:00
TB["工具箱视图<br/>toolbox/luxsin-controller/index.vue"]
2026-06-30 14:46:52 +08:00
end
L --> TV
TV --> R
TV --> T
L --> ST
2026-07-14 18:56:13 +08:00
TV --> TB
2026-06-30 14:46:52 +08:00
```
2026-07-10 16:51:05 +08:00
**图表来源**
2026-07-14 18:56:13 +08:00
- [index.vue:151](file://frontend/src/layout/index.vue#L151)
2026-06-30 14:46:52 +08:00
- [TabsView.vue:1-53](file://frontend/src/components/TabsView.vue#L1-L53)
2026-07-14 18:56:13 +08:00
- [index.js:1-109](file://frontend/src/router/index.js#L1-L109)
2026-06-30 14:46:52 +08:00
- [tabs.js:1-9](file://frontend/src/utils/tabs.js#L1-L9)
- [lux-theme.css:776-847](file://frontend/src/styles/lux-theme.css#L776-L847)
2026-07-14 18:56:13 +08:00
- [index.vue:1-231](file://frontend/src/views/toolbox/luxsin-controller/index.vue#L1-L231)
2026-06-30 14:46:52 +08:00
2026-07-10 16:51:05 +08:00
**章节来源**
2026-07-14 18:56:13 +08:00
- [index.vue:151](file://frontend/src/layout/index.vue#L151)
2026-06-30 14:46:52 +08:00
- [TabsView.vue:1-53](file://frontend/src/components/TabsView.vue#L1-L53)
2026-07-14 18:56:13 +08:00
- [index.js:1-109](file://frontend/src/router/index.js#L1-L109)
2026-06-30 14:46:52 +08:00
- [tabs.js:1-9](file://frontend/src/utils/tabs.js#L1-L9)
- [lux-theme.css:776-847](file://frontend/src/styles/lux-theme.css#L776-L847)
2026-07-14 18:56:13 +08:00
- [index.vue:1-231](file://frontend/src/views/toolbox/luxsin-controller/index.vue#L1-L231)
2026-06-30 14:46:52 +08:00
## 核心组件
- 标签页视图组件:负责标签集合的渲染、激活切换、关闭、右键菜单、持久化与 KeepAlive 缓存
- 路由系统:提供页面元信息(标题、图标),驱动标签页标题与图标生成
- 工具模块:提供标签页存储键名、首页路径等常量与清理函数
- 布局容器:承载标签页视图组件并提供面包屑导航与用户菜单
2026-07-10 16:51:05 +08:00
- 主题样式:提供深色主题变量与标签页视觉样式,支持玻璃拟态设计系统
2026-07-14 18:56:13 +08:00
- 工具箱视图:提供设备控制和数据同步功能的专用界面
2026-06-30 14:46:52 +08:00
2026-07-10 16:51:05 +08:00
**章节来源**
2026-06-30 14:46:52 +08:00
- [TabsView.vue:55-287](file://frontend/src/components/TabsView.vue#L55-L287)
2026-07-14 18:56:13 +08:00
- [index.js:6-72](file://frontend/src/router/index.js#L6-L72)
2026-06-30 14:46:52 +08:00
- [tabs.js:1-9](file://frontend/src/utils/tabs.js#L1-L9)
2026-07-14 18:56:13 +08:00
- [index.vue:151](file://frontend/src/layout/index.vue#L151)
- [lux-theme.css:776-847](file://frontend/src/styles/lux-theme.css#L776-L847)
2026-07-14 18:56:13 +08:00
- [index.vue:1-231](file://frontend/src/views/toolbox/luxsin-controller/index.vue#L1-L231)
2026-06-30 14:46:52 +08:00
## 架构总览
标签页视图组件通过路由钩子监听路由变化,动态生成或更新标签项;通过 Element Plus 的 Tabs 组件展示标签,通过 KeepAlive 实现组件缓存;通过 sessionStorage 持久化标签状态;通过右键菜单提供关闭、关闭其他、关闭全部等操作。**现代化改进**:实现了固定内边距策略避免布局抖动,统一的关闭按钮尺寸,改进的层级管理和增强的视觉反馈效果。
2026-06-30 14:46:52 +08:00
```mermaid
sequenceDiagram
participant Router as "路由系统"
participant TV as "标签页视图组件"
participant Store as "会话存储"
participant View as "路由视图"
Router->>TV : 触发路由变更
TV->>TV : upsertTab(标准化路由为标签)
TV->>Store : persist() 写入标签状态
TV->>View : 渲染当前路由组件(KeepAlive)
View-->>TV : 组件实例缓存
TV->>TV : handleTabClick/右键菜单/关闭
TV->>Store : persist() 更新状态
Note over TV : 固定内边距策略避免布局抖动
Note over TV : 14x14px统一关闭按钮尺寸
Note over TV : 改进的z-index层级管理
2026-06-30 14:46:52 +08:00
```
2026-07-10 16:51:05 +08:00
**图表来源**
2026-06-30 14:46:52 +08:00
- [TabsView.vue:176-286](file://frontend/src/components/TabsView.vue#L176-L286)
2026-07-14 18:56:13 +08:00
- [index.js:68-72](file://frontend/src/router/index.js#L68-L72)
2026-06-30 14:46:52 +08:00
2026-07-10 16:51:05 +08:00
**章节来源**
2026-06-30 14:46:52 +08:00
- [TabsView.vue:176-286](file://frontend/src/components/TabsView.vue#L176-L286)
2026-07-14 18:56:13 +08:00
- [index.js:68-72](file://frontend/src/router/index.js#L68-L72)
2026-06-30 14:46:52 +08:00
## 详细组件分析
### 数据结构设计
标签页数据结构包含以下关键字段:
- key:唯一标识,通常使用路由 fullPath
- fullPath/path/name:用于定位与跳转
- title:标签标题,来源于路由 meta.title 或 name 或 path
- icon:图标键值,映射到 Element Plus 图标组件
- closable:是否可关闭,首页不可关闭
```mermaid
classDiagram
class Tab {
+string key
+string fullPath
+string path
+string name
+string title
+string icon
+boolean closable
}
```
2026-07-10 16:51:05 +08:00
**图表来源**
2026-06-30 14:46:52 +08:00
- [TabsView.vue:88-103](file://frontend/src/components/TabsView.vue#L88-L103)
- [TabsView.vue:151-162](file://frontend/src/components/TabsView.vue#L151-L162)
2026-07-10 16:51:05 +08:00
**章节来源**
2026-06-30 14:46:52 +08:00
- [TabsView.vue:88-103](file://frontend/src/components/TabsView.vue#L88-L103)
- [TabsView.vue:151-162](file://frontend/src/components/TabsView.vue#L151-L162)
### 状态管理机制
- 激活状态:activeKey 双向绑定至 Element Plus Tabs,点击标签即激活
- 关闭操作:removeTabByKey 根据 key 移除标签,若关闭的是当前激活标签则自动切换到相邻标签或首页
2026-07-10 16:51:05 +08:00
- 重新加载:通过 router-view 的 key 基于 fullPath 变更触发组件重新渲染(非标签页层面的"刷新")
2026-06-30 14:46:52 +08:00
```mermaid
flowchart TD
Start(["开始"]) --> Click["点击标签"]
Click --> Activate["设置 activeKey 并匹配当前路由"]
Activate --> Push{"需要路由跳转?"}
Push --> |是| RoutePush["router.push(fullPath)"]
Push --> |否| End
RoutePush --> End(["结束"])
```
2026-07-10 16:51:05 +08:00
**图表来源**
2026-06-30 14:46:52 +08:00
- [TabsView.vue:193-200](file://frontend/src/components/TabsView.vue#L193-L200)
2026-07-10 16:51:05 +08:00
**章节来源**
2026-06-30 14:46:52 +08:00
- [TabsView.vue:193-200](file://frontend/src/components/TabsView.vue#L193-L200)
### 事件处理系统
- 标签点击:handleTabClick -> activateByKey
- 标签移除:handleTabRemove -> removeTabByKey
- 右键菜单:上下文菜单命令 close/close_others/close_all -> 对应处理函数
- 路由变化:watch(route.fullPath) -> upsertTab
```mermaid
sequenceDiagram
participant User as "用户"
participant Tabs as "Element Plus Tabs"
participant TV as "标签页视图组件"
User->>Tabs : 点击标签
Tabs-->>TV : @tab-click
TV->>TV : handleTabClick(key)
TV->>TV : activateByKey(key)
User->>Tabs : 右键标签
Tabs-->>TV : 上下文菜单命令
TV->>TV : handleContextCommand(cmd, key)
alt 关闭
TV->>TV : removeTabByKey(key)
else 关闭其他
TV->>TV : handleCloseOthers(currentKey)
else 关闭全部
TV->>TV : handleCloseAll()
end
```
2026-07-10 16:51:05 +08:00
**图表来源**
2026-06-30 14:46:52 +08:00
- [TabsView.vue:202-268](file://frontend/src/components/TabsView.vue#L202-L268)
2026-07-10 16:51:05 +08:00
**章节来源**
2026-06-30 14:46:52 +08:00
- [TabsView.vue:202-268](file://frontend/src/components/TabsView.vue#L202-L268)
### 生命周期管理与缓存策略
- 组件挂载:onMounted 中恢复标签状态并确保当前路由存在对应标签
- KeepAlive 缓存:computed 计算 keepAliveInclude,基于所有有 name 的标签 name 去重后传入 KeepAlive include
- 内存优化:通过 include 白名单控制缓存范围,减少不必要的组件实例保活
- 性能监控:watch 监听 tabs 与 activeKey 变化以触发持久化,避免频繁写入
```mermaid
flowchart TD
Mount["onMounted"] --> Restore["restore() 恢复标签状态"]
Restore --> Upsert["upsertTab 当前路由"]
Watch["watch(route.fullPath)"] --> Upsert
Watch2["watch(tabs + activeKey)"] --> Persist["persist() 持久化"]
KeepAlive["computed keepAliveInclude"] --> Cache["KeepAlive include"]
```
2026-07-10 16:51:05 +08:00
**图表来源**
2026-06-30 14:46:52 +08:00
- [TabsView.vue:270-286](file://frontend/src/components/TabsView.vue#L270-L286)
- [TabsView.vue:120-123](file://frontend/src/components/TabsView.vue#L120-L123)
2026-07-10 16:51:05 +08:00
**章节来源**
2026-06-30 14:46:52 +08:00
- [TabsView.vue:270-286](file://frontend/src/components/TabsView.vue#L270-L286)
- [TabsView.vue:120-123](file://frontend/src/components/TabsView.vue#L120-L123)
### 与路由系统的集成与状态同步
- 路由元信息:路由 meta.title 提供标签标题,meta.icon 提供图标键值
- 首页特殊处理:HOME_PATH 对应标签不可关闭
- 路由跳转:激活标签时若 fullPath 与当前不同则执行 router.push
- 子路由处理:根布局路由(path='/')不加入标签,children 的实际页面才加入
2026-07-14 18:56:13 +08:00
- **工具箱集成**:工具箱路由 `/toolbox/luxsin-controller` 配置了 `icon: 'tools'` 元信息,支持在标签页中显示工具箱图标
2026-06-30 14:46:52 +08:00
```mermaid
sequenceDiagram
participant Router as "路由系统"
participant TV as "标签页视图组件"
participant Route as "当前路由"
Router->>TV : beforeEach/to
TV->>TV : normalizeTabFromRoute(Route)
TV->>TV : upsertTab(标准化后的标签)
TV->>TV : activateByKey(匹配 key)
alt 需要跳转
TV->>Router : router.push(fullPath)
end
2026-07-14 18:56:13 +08:00
Note over TV : 工具箱路由支持 tools 图标
2026-06-30 14:46:52 +08:00
```
2026-07-10 16:51:05 +08:00
**图表来源**
2026-06-30 14:46:52 +08:00
- [TabsView.vue:88-103](file://frontend/src/components/TabsView.vue#L88-L103)
2026-07-16 16:34:18 +08:00
- [TabsView.vue:180-191](file://frontend/src/components/TabsView.vue#L180-191)
2026-06-30 14:46:52 +08:00
- [TabsView.vue:193-200](file://frontend/src/components/TabsView.vue#L193-L200)
2026-07-14 18:56:13 +08:00
- [index.js:68-72](file://frontend/src/router/index.js#L68-L72)
2026-06-30 14:46:52 +08:00
2026-07-10 16:51:05 +08:00
**章节来源**
2026-06-30 14:46:52 +08:00
- [TabsView.vue:88-103](file://frontend/src/components/TabsView.vue#L88-L103)
2026-07-16 16:34:18 +08:00
- [TabsView.vue:180-191](file://frontend/src/components/TabsView.vue#L180-191)
2026-06-30 14:46:52 +08:00
- [TabsView.vue:193-200](file://frontend/src/components/TabsView.vue#L193-L200)
2026-07-14 18:56:13 +08:00
- [index.js:68-72](file://frontend/src/router/index.js#L68-L72)
2026-06-30 14:46:52 +08:00
### 现代化设计系统与视觉增强
2026-06-30 14:46:52 +08:00
**重大更新** 实现了现代化的标签页设计系统,解决了传统卡片标签的布局抖动问题
2026-07-10 16:51:05 +08:00
- **固定内边距策略**:通过固定 padding-left 和 padding-right 为16px,彻底解决了 Element Plus 卡片标签在悬停时因关闭按钮展开导致的布局抖动问题
- **一致的关闭按钮尺寸**:统一关闭按钮尺寸为14x14px,确保所有标签的视觉一致性
- **改进的层级管理**:活动标签 z-index 设置为2,悬停标签 z-index 也设置为2,确保正确的视觉层次关系
- **增强的视觉反馈**:活动标签添加青色内嵌阴影 `inset 0 2px 0 var(--lux-cyan)`,提供清晰的激活状态指示
- **平滑过渡动画**:标签背景色、颜色、边框颜色和阴影都添加了0.2s的平滑过渡效果
- **玻璃拟态设计**:标签页采用半透明背景和模糊效果,与现代设计系统保持一致
- **优化的间距管理**:标签间间距固定为6px,避免动态变化导致的布局不稳定
2026-07-10 16:51:05 +08:00
**新增特性**
- 固定内边距策略消除布局抖动
- 统一的14x14px关闭按钮尺寸
- 改进的z-index层级管理系统
- 青色内嵌阴影激活指示器
- 0.2s平滑过渡动画效果
- 玻璃拟态视觉风格集成
2026-07-10 16:51:05 +08:00
**章节来源**
- [lux-theme.css:776-847](file://frontend/src/styles/lux-theme.css#L776-L847)
2026-07-10 16:51:05 +08:00
- [TabsView.vue:320-324](file://frontend/src/components/TabsView.vue#L320-L324)
2026-06-30 14:46:52 +08:00
- [TabsView.vue:64-76](file://frontend/src/components/TabsView.vue#L64-L76)
- [TabsView.vue:46-50](file://frontend/src/components/TabsView.vue#L46-L50)
2026-07-14 18:56:13 +08:00
- [index.js:68-72](file://frontend/src/router/index.js#L68-L72)
2026-06-30 14:46:52 +08:00
## 依赖关系分析
- 组件依赖:TabsView.vue 依赖 vue-router、@element-plus/icons-vue、utils/tabs 常量
- 路由依赖:路由配置提供 meta.title/meta.icon,影响标签标题与图标
- 布局依赖:Layout 将 TabsView 作为主内容区的一部分
2026-07-14 18:56:13 +08:00
- **工具箱依赖**:工具箱视图组件独立实现设备控制功能,通过路由系统集成到标签页系统中
2026-06-30 14:46:52 +08:00
```mermaid
graph LR
TV["TabsView.vue"] --> VR["vue-router"]
TV --> EP["@element-plus/icons-vue"]
TV --> UT["utils/tabs.js"]
UT --> C["常量: TABS_STORAGE_KEY, HOME_PATH"]
TV --> RT["router/index.js"]
L["layout/index.vue"] --> TV
2026-07-14 18:56:13 +08:00
TB["toolbox/luxsin-controller/index.vue"] --> TV
2026-06-30 14:46:52 +08:00
```
2026-07-10 16:51:05 +08:00
**图表来源**
- [TabsView.vue:56-59](file://frontend/src/components/TabsView.vue#L56-L59)
2026-06-30 14:46:52 +08:00
- [tabs.js:1-9](file://frontend/src/utils/tabs.js#L1-L9)
2026-07-14 18:56:13 +08:00
- [index.js:1-109](file://frontend/src/router/index.js#L1-L109)
- [index.vue:151](file://frontend/src/layout/index.vue#L151)
- [index.vue:1-231](file://frontend/src/views/toolbox/luxsin-controller/index.vue#L1-L231)
2026-06-30 14:46:52 +08:00
2026-07-10 16:51:05 +08:00
**章节来源**
- [TabsView.vue:56-59](file://frontend/src/components/TabsView.vue#L56-L59)
2026-06-30 14:46:52 +08:00
- [tabs.js:1-9](file://frontend/src/utils/tabs.js#L1-L9)
2026-07-14 18:56:13 +08:00
- [index.js:1-109](file://frontend/src/router/index.js#L1-L109)
- [index.vue:151](file://frontend/src/layout/index.vue#L151)
- [index.vue:1-231](file://frontend/src/views/toolbox/luxsin-controller/index.vue#L1-L231)
2026-06-30 14:46:52 +08:00
## 性能考量
- KeepAlive 缓存:仅缓存有 name 的标签组件,避免无意义的实例保活
- 持久化频率:通过 watch 监听 tabs 与 activeKey 变化进行持久化,减少频繁写入
- DOM 重绘:标签标题与图标采用固定宽度与省略号,避免布局抖动
- 路由跳转:仅在 fullPath 与当前不同才执行跳转,避免重复导航
- **动画性能**:使用 CSS transition 而非 JavaScript 动画,确保0.2s过渡动画的流畅性
- **布局稳定性**:固定内边距策略消除了悬停时的布局重排,提升滚动性能
2026-07-14 18:56:13 +08:00
- **工具箱性能**:工具箱视图组件使用独立的请求处理和错误处理机制,避免影响主标签页性能
2026-06-30 14:46:52 +08:00
## 故障排查指南
- 标签无法关闭:检查 closable 字段,首页标签默认不可关闭
- 标题显示异常:检查路由 meta.title 是否存在,否则回退到 name 或 path
- 图标不显示:检查 meta.icon 键值是否正确且在 iconMap 中有对应映射
- 标签状态丢失:检查 sessionStorage 写入权限与容量限制
- 路由跳转无效:检查 fullPath 与当前路由是否一致,避免不必要的 router.push
- **布局抖动问题**:确认使用了固定内边距策略,避免 Element Plus 默认的动态padding行为
- **关闭按钮尺寸不一致**:检查CSS规则是否正确应用了14x14px的统一尺寸
- **层级显示异常**:确认活动标签和悬停标签的z-index设置正确
- **动画卡顿**:检查浏览器是否支持CSS transition和backdrop-filter属性
2026-07-14 18:56:13 +08:00
- **工具箱图标问题**:确认工具箱路由配置了正确的 `icon: 'tools'` 元信息,且 iconMap 中包含 `tools: Tools` 映射
2026-06-30 14:46:52 +08:00
2026-07-10 16:51:05 +08:00
**章节来源**
2026-06-30 14:46:52 +08:00
- [TabsView.vue:101-101](file://frontend/src/components/TabsView.vue#L101-L101)
- [TabsView.vue:78-81](file://frontend/src/components/TabsView.vue#L78-L81)
- [TabsView.vue:64-76](file://frontend/src/components/TabsView.vue#L64-L76)
- [TabsView.vue:125-141](file://frontend/src/components/TabsView.vue#L125-L141)
- [TabsView.vue:197-199](file://frontend/src/components/TabsView.vue#L197-L199)
- [lux-theme.css:776-847](file://frontend/src/styles/lux-theme.css#L776-L847)
2026-07-14 18:56:13 +08:00
- [index.js:68-72](file://frontend/src/router/index.js#L68-L72)
2026-06-30 14:46:52 +08:00
## 结论
标签页视图组件通过清晰的数据结构、完善的事件处理与路由集成,实现了标签的激活、关闭、右键菜单与持久化。**现代化改进**:通过实现固定内边距策略、统一的关闭按钮尺寸、改进的层级管理和增强的视觉反馈效果,显著提升了用户体验和界面稳定性。结合 KeepAlive 缓存与现代化主题样式,提供了优秀的交互性能和美观的界面表现。工具箱功能的集成进一步完善了系统的功能完整性,为用户提供了便捷的设备管理和数据同步工具。建议在扩展新功能时遵循现有模式,保持标签状态与路由状态的一致性,并注意缓存范围与持久化策略的平衡。
2026-06-30 14:46:52 +08:00
## 附录
- 常用配置项
- 存储键名:TABS_STORAGE_KEY
- 首页路径:HOME_PATH
2026-07-14 18:56:13 +08:00
- 图标映射:document/list/upload/collection/home/user/tools
- **现代化设计配置**
- 固定内边距:padding-left: 16px, padding-right: 16px
- 关闭按钮尺寸:width: 14px, height: 14px
- 层级管理:活动标签 z-index: 2, 悬停标签 z-index: 2
- 过渡动画:transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease
- 激活指示器:box-shadow: inset 0 2px 0 var(--lux-cyan)
2026-07-14 18:56:13 +08:00
- **工具箱功能配置**
- 路由路径:/toolbox/luxsin-controller
- 图标配置:icon: 'tools'
- 功能描述:设备数据同步和控制工具
- **最佳实践**
2026-06-30 14:46:52 +08:00
- 在路由 meta 中提供 title 与 icon,确保标签显示一致性
- 控制 KeepAlive include 范围,避免过度缓存
2026-07-10 16:51:05 +08:00
- 使用 sessionStorage 进行轻量级状态持久化,避免频繁写入
2026-07-14 18:56:13 +08:00
- 利用 CSS transition 实现流畅的用户交互反馈
- 为新功能模块配置合适的图标和元信息,确保在标签页中正确显示
- 使用固定内边距策略避免标签页布局抖动
- 统一关闭按钮尺寸确保视觉一致性