侧栏从 sticky 改 fixed:sticky 的位置跟着 scrollTop 走,滚到底时 scrollTop 是 scrollHeight 减 clientHeight,在 Windows 显示缩放下是 小数,部分图标会跳 1px;fixed 按视口摆放,不参与这个运算。网格第一列 只当占位,主区显式站到第二列。 错误提示是拿去粘贴排查的,点击改成复制而不是关闭,关闭交给自动消失; 局域网 http 下没有 clipboard API,退回 execCommand。撤回/重做各加 2.5 秒冷却,窗内连点算一次,顺带避开重做备份名的同秒覆盖。弹窗打开 时锁住背景滚动,滚动条位置由 scrollbar-gutter 常驻,不横向跳。
30 lines
1.0 KiB
TypeScript
30 lines
1.0 KiB
TypeScript
/**
|
|
* 左侧导航。
|
|
*
|
|
* 仪表盘打头(打开先看一眼状态),路由紧随其后(这个工具存在的理由),设置垫底。
|
|
*/
|
|
import IconRoute from '~icons/ri/route-line'
|
|
import IconDashboard from '~icons/ri/dashboard-line'
|
|
import IconConfig from '~icons/ri/file-list-3-line'
|
|
import IconRules from '~icons/ri/filter-3-line'
|
|
import IconLogs from '~icons/ri/terminal-line'
|
|
import IconConnections from '~icons/ri/links-line'
|
|
import IconSettings from '~icons/ri/settings-3-line'
|
|
import type { Component } from 'vue'
|
|
|
|
export interface NavItem {
|
|
key: string
|
|
label: string
|
|
icon: Component
|
|
}
|
|
|
|
export const NAV: NavItem[] = [
|
|
{ key: 'dashboard', label: '仪表盘', icon: IconDashboard },
|
|
{ key: 'router', label: '路由', icon: IconRoute },
|
|
{ key: 'config', label: '配置', icon: IconConfig },
|
|
{ key: 'rules', label: '规则', icon: IconRules },
|
|
{ key: 'requests', label: '日志', icon: IconLogs },
|
|
{ key: 'connections', label: '连接', icon: IconConnections },
|
|
{ key: 'settings', label: '设置', icon: IconSettings },
|
|
]
|