@qilitt-mickey/vue3-temp-skill 1.1.16 → 1.1.18
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/SKILL.md
CHANGED
|
@@ -13,7 +13,7 @@ tags: [vue3, typescript, element-plus, vant, pinia, vite, unocss, crud, componen
|
|
|
13
13
|
|
|
14
14
|
- 面向由 **vue3-web-temp** 脚手架搭出的业务项目(目录名/安装路径因人而异,以当前工作区为准)
|
|
15
15
|
- 业务写法以本包 `references/` 为准;壳层行为(顶部 tag / 侧栏 / keep-alive / `useDetail`)以**当前项目**已有实现为准
|
|
16
|
-
- **双轨**:无设计 handoff →
|
|
16
|
+
- **双轨**:无设计 handoff → 保持模版出厂;有设计落地 → 读 `design-handoff.md` **原子步骤**(`Theme`/`Version`/令牌整组,禁止只改主色)
|
|
17
17
|
|
|
18
18
|
## 使用方式
|
|
19
19
|
|
package/package.json
CHANGED
|
@@ -103,7 +103,7 @@ lint / type-check **过了也不能放过**下列项。发现即改代码,禁
|
|
|
103
103
|
- [ ] 规范识别回执;令牌 / `platform-config.json` / 侧栏主题一致
|
|
104
104
|
- [ ] 已建 `design-tokens.scss`;`index.scss` 中其 `@use` 最前
|
|
105
105
|
- [ ] 冲突清单已逐条处理(见 `design-system`)
|
|
106
|
-
- [ ] 有上游设计产出时已读 `design-handoff`:JSON
|
|
106
|
+
- [ ] 有上游设计产出时已读 `design-handoff`:JSON 优先;**原子步骤**含 `Theme=default`(深色侧栏)+ `--sidebar-*` + **`Version++`** + 主色阶;禁止只改 EpThemeColor;错误色 `#F5222D`
|
|
107
107
|
- [ ] **无**设计落地时未改出厂主色 / ShowModel / 壳层 / 弹窗几何默认
|
|
108
108
|
- [ ] 组件尺寸三档已落地并桥接 `--el-component-size*`;缺档落到 default;未全局强制 `size="small"`;**查询区不写 size**(三档对照表 ≠ 查询区要用 small)
|
|
109
109
|
|
|
@@ -11,11 +11,29 @@ tags: [handoff, design-tokens, upstream, artifacts, json]
|
|
|
11
11
|
|
|
12
12
|
| 场景 | 行为 |
|
|
13
13
|
|------|------|
|
|
14
|
-
| **未调用设计 / 无 handoff** |
|
|
15
|
-
| **有 design-handoff/v1 或用户要求按设计落地** |
|
|
14
|
+
| **未调用设计 / 无 handoff** | 保持模版出厂(主色 `#409EFF`、`Theme: light`=**白侧栏**、`ShowModel: chrome`、margin 8 等)。**禁止**为「看起来像设计」而改出厂 |
|
|
15
|
+
| **有 design-handoff/v1 或用户要求按设计落地** | 按下文「落地原子步骤」**整组**回填;只改主色/令牌、不改 `Theme`/`Version` = **落地失败** |
|
|
16
16
|
|
|
17
|
-
跨编辑器一致:设计侧 `handoff-output.md
|
|
18
|
-
|
|
17
|
+
跨编辑器一致:设计侧 `handoff-output.md`(JSON 形状)+ 本文件(→ 模版映射)+ 模版令牌。
|
|
18
|
+
**分工**:设计师改视觉正文;本文件规定 Agent 如何落到模版。禁止只改文档不改令牌。
|
|
19
|
+
|
|
20
|
+
### 出厂 vs 设计:侧栏两套开关(易错)
|
|
21
|
+
|
|
22
|
+
| 概念 | 出厂 | 设计 page-templates「浅色模式」 |
|
|
23
|
+
|------|------|--------------------------------|
|
|
24
|
+
| 内容区 | OverallStyle=light | OverallStyle=light / contentMode=light |
|
|
25
|
+
| 侧栏 | **`Theme=light` → 白菜单** | **`Theme=default` + `--sidebar-bg:#001529`** |
|
|
26
|
+
| 主色 | EpThemeColor `#409EFF` | `tokens.brandPrimary`(如钴蓝 `#1B4FE0`) |
|
|
27
|
+
|
|
28
|
+
**禁止**:把设计「浅色」写成 `Theme=light`。`contentMode/OverallStyle=light` 与 `Theme=light` 不是一回事。
|
|
29
|
+
|
|
30
|
+
### `Version` 必须生效(落地核心)
|
|
31
|
+
|
|
32
|
+
模版 `layout` / `configure` **优先读 localStorage**。只改 `platform-config.json` 而浏览器仍缓存 `Theme=light` → 侧栏一直白。
|
|
33
|
+
|
|
34
|
+
模版已在 `injectResponsiveStorage`:当 **`Version` 与上次不同** 时删除 `layout`+`configure` 并按新配置重灌。
|
|
35
|
+
|
|
36
|
+
因此设计落地时:**`Version` 必须自增**(如 `0.0.5` → `0.0.6`),否则 handoff 写了 `Theme=default` 也不会进页面。
|
|
19
37
|
|
|
20
38
|
## 触发
|
|
21
39
|
|
|
@@ -62,16 +80,14 @@ tags: [handoff, design-tokens, upstream, artifacts, json]
|
|
|
62
80
|
|-----------|------|------|
|
|
63
81
|
| `tokens.brandPrimary` | `platform-config.json` → `EpThemeColor` | HEX;并 bump `Version` |
|
|
64
82
|
| `shell.darkMode` | `platform-config.json` → `DarkMode` | boolean |
|
|
65
|
-
| `shell.sidebar` | `platform-config.json` →
|
|
66
|
-
| `shell.
|
|
67
|
-
| `shell.
|
|
68
|
-
| `shell.showModel` | `
|
|
69
|
-
| `shell.contentMargin` | `--layout-content-padding
|
|
83
|
+
| `shell.sidebar` | `platform-config.json` → **`Theme`** + `--sidebar-*` | **`dark-gradient`(设计默认)→ `Theme: "default"`**(深色侧栏);仅当设计明确要白菜单才 `"light"`。**禁止**因 contentMode=light 写成 Theme=light |
|
|
84
|
+
| `shell.contentMode` / `darkMode` | `OverallStyle` / `DarkMode` | 设计浅色内容:`OverallStyle: "light"` + `DarkMode: false` |
|
|
85
|
+
| `shell.dataTheme` | 可选;缺省时 `dark-gradient` → 运行时 `data-theme=default` | 与 Theme 一致 |
|
|
86
|
+
| `shell.showModel` | `ShowModel` | 以 JSON 为准(设计常 `line`) |
|
|
87
|
+
| `shell.contentMargin` | `--layout-content-padding` / `--vts-margin` | 如 `24`;有 handoff 才覆盖出厂 8 |
|
|
88
|
+
| (整次落地) | **`Version` 自增** | **必做**;否则 localStorage 不重灌,Theme/ShowModel 不生效 |
|
|
70
89
|
|
|
71
|
-
|
|
72
|
-
- **`card`**:写 `--vts-tag-card-*`(见 geometry)
|
|
73
|
-
- **`line`**:无容器文字页签(见 `notes` / `homeTabSize` / `tagDividerWidth`);模版若尚未实现该枚举 → 回执「待实现 line」,**禁止**静默改成 `card`;可先落令牌与配置,页签样式单开任务
|
|
74
|
-
- **`chrome` / `smart`**:仅当 JSON 明确要求时写入
|
|
90
|
+
写入后:硬刷新或等 Version 失效逻辑清掉旧 `layout`/`configure`。
|
|
75
91
|
|
|
76
92
|
### `geometry` → 令牌
|
|
77
93
|
|
|
@@ -162,25 +178,58 @@ tags: [handoff, design-tokens, upstream, artifacts, json]
|
|
|
162
178
|
| JSON=`line` 且模版无实现 | 回执待实现;勿改写成 `card` |
|
|
163
179
|
| 用户在设置面板手动切换 | 以用户选择为准 |
|
|
164
180
|
|
|
165
|
-
侧栏派生(`shell.sidebar === "dark-gradient"`
|
|
181
|
+
侧栏派生(`shell.sidebar === "dark-gradient"` 时 **整组必写**):
|
|
182
|
+
|
|
183
|
+
> 设计「浅色模式」= 内容浅 + 侧栏 `#001529`。落地时:
|
|
184
|
+
|
|
185
|
+
```json
|
|
186
|
+
// platform-config.json(示例片段)
|
|
187
|
+
{
|
|
188
|
+
"Version": "<原值+1>",
|
|
189
|
+
"Theme": "default",
|
|
190
|
+
"OverallStyle": "light",
|
|
191
|
+
"DarkMode": false,
|
|
192
|
+
"EpThemeColor": "<brandPrimary>"
|
|
193
|
+
}
|
|
194
|
+
```
|
|
166
195
|
|
|
167
196
|
```scss
|
|
168
|
-
|
|
169
|
-
--sidebar-
|
|
170
|
-
--sidebar-
|
|
197
|
+
/* design-tokens.scss */
|
|
198
|
+
--sidebar-bg: #001529;
|
|
199
|
+
--sidebar-logo-bg: #002140;
|
|
200
|
+
--sidebar-border-color: transparent;
|
|
171
201
|
--sidebar-menu-text: rgb(255 255 255 / 65%);
|
|
172
202
|
--sidebar-menu-text-hover: #fff;
|
|
173
203
|
--sidebar-menu-active-text: #fff;
|
|
174
|
-
--sidebar-menu-hover-bg:
|
|
175
|
-
--sidebar-menu-active-bg: var(--primary-
|
|
176
|
-
--sidebar-submenu-bg: color-mix(in srgb,
|
|
177
|
-
--sidebar-active-indicator: var(--primary-
|
|
204
|
+
--sidebar-menu-hover-bg: rgb(255 255 255 / 8%);
|
|
205
|
+
--sidebar-menu-active-bg: var(--primary-color);
|
|
206
|
+
--sidebar-submenu-bg: color-mix(in srgb, #001529 82%, #000);
|
|
207
|
+
--sidebar-active-indicator: var(--primary-color);
|
|
178
208
|
```
|
|
179
209
|
|
|
180
|
-
`theme.scss
|
|
210
|
+
`theme.scss` 中 `html[data-theme='default']` 已桥接 `--sidebar-*`。
|
|
211
|
+
自检:DevTools 中 `html` 的 `data-theme="default"`,`.sidebar-container` 背景为 `#001529`(非 `#fff`)。
|
|
181
212
|
|
|
182
213
|
---
|
|
183
214
|
|
|
215
|
+
## 落地原子步骤(Agent 必按序;缺一步=失败)
|
|
216
|
+
|
|
217
|
+
有 `design-handoff/v1` 时,**同一轮**完成:
|
|
218
|
+
|
|
219
|
+
1. 回执(规范识别)
|
|
220
|
+
2. 写 `design-tokens.scss`:`brand*` / `primaryScale` / 几何 / **`--sidebar-*`(dark-gradient)** / contentMargin
|
|
221
|
+
3. 写 `platform-config.json`(**整组**):
|
|
222
|
+
- `EpThemeColor` = brandPrimary
|
|
223
|
+
- `Theme` = **`default`**(若 `shell.sidebar=dark-gradient`)
|
|
224
|
+
- `OverallStyle` = `light`(若 contentMode=light)
|
|
225
|
+
- `DarkMode` = shell.darkMode
|
|
226
|
+
- `ShowModel` = shell.showModel
|
|
227
|
+
- **`Version` 自增**(字符串或数字均可,须与上次不同)
|
|
228
|
+
4. 核对表 A~E;硬失败项见下
|
|
229
|
+
5. 回执「已覆盖 / 保留出厂」;提醒用户**硬刷新**一次(Version 会清 layout 缓存)
|
|
230
|
+
|
|
231
|
+
**反例(禁止)**:只改 `EpThemeColor` / `:root` 主色 → 侧栏仍白、像「没落地」。
|
|
232
|
+
|
|
184
233
|
## 规范识别回执(动手前必出)
|
|
185
234
|
|
|
186
235
|
```markdown
|
|
@@ -258,8 +307,9 @@ tags: [handoff, design-tokens, upstream, artifacts, json]
|
|
|
258
307
|
| 侧栏宽 / 收起 | `--sidebar-width` / `--sidebar-collapsed-width` | 208 / 64 |
|
|
259
308
|
| 内容区内边距 | `--layout-content-padding` → `--vts-margin` | 出厂 8;设计常 24 |
|
|
260
309
|
| 页脚高 | `--layout-footer-height` | 48 |
|
|
261
|
-
| 页签风格 | `ShowModel` = JSON `shell.showModel
|
|
262
|
-
|
|
|
310
|
+
| 页签风格 | `ShowModel` = JSON `shell.showModel` | 未落地勿改 |
|
|
311
|
+
| 侧栏(设计浅色页) | `Theme=default` + `--sidebar-bg:#001529` + **Version++** | 出厂 `Theme=light` 白侧栏;落地勿漏 |
|
|
312
|
+
| 页签关闭/错误色 | `--error-color` / `--error-6` | `#F5222D` |
|
|
263
313
|
|
|
264
314
|
### B. 色板与文字
|
|
265
315
|
|
|
@@ -297,11 +347,11 @@ tags: [handoff, design-tokens, upstream, artifacts, json]
|
|
|
297
347
|
|
|
298
348
|
### E. 落地后自检
|
|
299
349
|
|
|
300
|
-
- [ ] `platform-config`:`EpThemeColor`
|
|
301
|
-
- [ ]
|
|
350
|
+
- [ ] `platform-config`:`EpThemeColor` + **`Theme=default`(深色侧栏)** + `OverallStyle` + `ShowModel` + **`Version++`**
|
|
351
|
+
- [ ] `--sidebar-bg` 为 `#001529`;运行时 `data-theme=default`(不是 light)
|
|
352
|
+
- [ ] 硬刷新后侧栏仍深色(证明 Version 已清缓存)
|
|
302
353
|
- [ ] grep 壳层与 ReDialog:无不可覆盖裸 px
|
|
303
|
-
- [ ]
|
|
304
|
-
- [ ] 回执列出「已覆盖 / 保留出厂」字段清单
|
|
354
|
+
- [ ] 回执列出「已覆盖 / 保留出厂」
|
|
305
355
|
|
|
306
356
|
---
|
|
307
357
|
|
|
@@ -309,9 +359,11 @@ tags: [handoff, design-tokens, upstream, artifacts, json]
|
|
|
309
359
|
|
|
310
360
|
| 条件 | 处理 |
|
|
311
361
|
|------|------|
|
|
312
|
-
|
|
|
362
|
+
| 设计 `sidebar=dark-gradient` 但 `Theme` 仍为 `light`(或未改) | **硬失败**:改为 `default` 并 Version++ |
|
|
363
|
+
| 设计落地只改了主色/tokens,未改 Theme / Version | **硬失败**:补全原子步骤 |
|
|
364
|
+
| 用户要求按设计落地,但未写入 JSON 中的 `shell.showModel` | 硬失败:按 JSON 补写 |
|
|
313
365
|
| JSON 有 `primaryScale` 但未写入 `--primary-0..9` | 硬失败 |
|
|
314
|
-
| 用 `#F56C6C` 或未映射的 EP danger 代替 `tokens.error` | 硬失败:改为 `#F5222D`
|
|
315
|
-
| 改了
|
|
316
|
-
| 设计落地后壳层/弹窗写死 px
|
|
317
|
-
|
|
|
366
|
+
| 用 `#F56C6C` 或未映射的 EP danger 代替 `tokens.error` | 硬失败:改为 `#F5222D` |
|
|
367
|
+
| 改了 margin 后列表仍用 `100vh` 减顶栏 | 硬失败:迁 flex/`vts-page-card` |
|
|
368
|
+
| 设计落地后壳层/弹窗写死 px | 硬失败:改 `var(--…)` |
|
|
369
|
+
| 核对表有漏项且未标「保留出厂」 | 硬失败 |
|
|
@@ -434,7 +434,7 @@ height: \d+px、padding: \d+px、font-size: \d+px、行内 style="...颜色 hex"
|
|
|
434
434
|
- [ ] 定高列表页:`el-card.vts-page-card` + `useTableSearch` 的 `tableHeight`;换 `--card-padding` 后列表仍无外层滚动条、分页完整、仅表格体内滚动
|
|
435
435
|
- [ ] 表单标签:computed font-weight 为规范值(AntD/Semi = 400,非 700)
|
|
436
436
|
- [ ] 弹窗:`--ds-dialog-bg` 为 **主题色轻渐变**(`primary-bg → component-bg`),非写死蓝渐变;`ElMessageBox` 内容区用 `--message-box-content-padding`(比 `el-dialog` body 更紧凑)
|
|
437
|
-
- [ ] 侧栏:深色主题下 DevTools 检查 `.sidebar-container` computed `background` 为
|
|
437
|
+
- [ ] 侧栏:深色主题下 DevTools 检查 `.sidebar-container` computed `background` 为 **`#001529`**(`var(--sidebar-bg)`,非旧版主色纵向渐变);激活项块色 = `--primary-color` / `brandPrimary`;Logo 区 = `--sidebar-logo-bg`
|
|
438
438
|
- [ ] 第四节冲突清单全部处理完毕(逐条回填)
|
|
439
439
|
- [ ] Step 7 存量扫描已执行且结果已输出
|
|
440
440
|
|
|
@@ -617,7 +617,7 @@ height: \d+px、padding: \d+px、font-size: \d+px、行内 style="...颜色 hex"
|
|
|
617
617
|
| `--el-menu-item-height` | 菜单项行高 / menuItemHeight / navItemHeight |
|
|
618
618
|
| `--sidebar-collapse-bar-height` | 侧栏折叠条高度 / collapseTriggerHeight |
|
|
619
619
|
| `--primary-0`~`--primary-9` | 会话令牌 CSS 块 / primaryScale / 10 级主色 |
|
|
620
|
-
| `--sidebar-bg` / `--sidebar-menu-active-bg` |
|
|
620
|
+
| `--sidebar-bg` / `--sidebar-menu-active-bg` | 侧栏深色底 `#001529` / 菜单激活纯色 `primary-color` |
|
|
621
621
|
|
|
622
622
|
#### 7.5.3 壳层令牌变更后的连锁巡检(按令牌名,不写死像素)
|
|
623
623
|
|
|
@@ -64,8 +64,8 @@ tags: [vue3, layout, theme, dark-mode, css-variables, design-tokens, element-plu
|
|
|
64
64
|
|
|
65
65
|
| 主题名 | 中文名 | 说明 |
|
|
66
66
|
|--------|--------|------|
|
|
67
|
-
| `light` | 亮白色 |
|
|
68
|
-
| `default` | 道奇蓝 |
|
|
67
|
+
| `light` | 亮白色 | **白侧栏**(模版出厂常见 `Theme`) |
|
|
68
|
+
| `default` | 道奇蓝 | **深色侧栏** `#001529`(设计 handoff `sidebar=dark-gradient` 必须切到此项) |
|
|
69
69
|
| `saucePurple` | 深紫罗兰 | 深色侧栏 |
|
|
70
70
|
| `pink` | 深粉色 | 深色侧栏 |
|
|
71
71
|
| `dusk` | 猩红色 | 深色侧栏 |
|
|
@@ -73,7 +73,8 @@ tags: [vue3, layout, theme, dark-mode, css-variables, design-tokens, element-plu
|
|
|
73
73
|
| `mingQing` | 绿宝石 | 深色侧栏 |
|
|
74
74
|
| `auroraGreen` | 酸橙绿 | 深色侧栏 |
|
|
75
75
|
|
|
76
|
-
>
|
|
76
|
+
> **正交**:`OverallStyle`/`DarkMode` = 内容区浅/深;`Theme` = 侧栏配色。设计「浅色模式」≠ `Theme=light`。
|
|
77
|
+
> 设计落地:`Theme=default` + `--sidebar-*` + **`Version` 自增**(见 `design-handoff`;否则 localStorage 仍白侧栏)。
|
|
77
78
|
|
|
78
79
|
### 2.1.1 侧栏扩展变量(设计技能落地后写入)
|
|
79
80
|
|
|
@@ -97,8 +98,9 @@ tags: [vue3, layout, theme, dark-mode, css-variables, design-tokens, element-plu
|
|
|
97
98
|
|
|
98
99
|
**关键逻辑**:
|
|
99
100
|
- 主色通过 `document.documentElement.style.setProperty('--el-color-primary', color)` 直接设置。
|
|
100
|
-
- `light` 和 `default`
|
|
101
|
-
-
|
|
101
|
+
- `light` 和 `default` 使用配置里的 `EpThemeColor`;其它主题用色卡色。
|
|
102
|
+
- 整体切暗黑且当前为 `light`(白侧栏)时,自动切到 `default`。
|
|
103
|
+
- 设计落地必须把 `Theme` 写成 `default` 并 **Version++**,不能只改主色。
|
|
102
104
|
|
|
103
105
|
### 2.3 自定义主题色配置
|
|
104
106
|
|