mvframe 1.0.82 → 1.0.83
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/.cursor/rules/style-system.mdc +45 -0
- package/README.cn.md +23 -0
- package/README.md +23 -0
- package/dist/vendor.js +1 -1
- package/package.json +1 -1
- package/scripts/scaffold-app.js +23 -0
|
@@ -238,6 +238,51 @@ alwaysApply: true
|
|
|
238
238
|
| `tipbtn bottom/left/right` | 控制提示方向 |
|
|
239
239
|
| `MvcIcon` | 组件图标类,默认 `flex-shrink: 0` |
|
|
240
240
|
|
|
241
|
+
### 表单 Label(element.scss)
|
|
242
|
+
|
|
243
|
+
`Input`、`Textarea`、`Select`、`SelectV2` 支持统一的 label 接口:
|
|
244
|
+
|
|
245
|
+
| 属性 | 用途 |
|
|
246
|
+
|------|------|
|
|
247
|
+
| `label` | 显示表单标题 |
|
|
248
|
+
| `material-label` | 启用 Material 风格浮动 label |
|
|
249
|
+
|
|
250
|
+
使用规则:
|
|
251
|
+
|
|
252
|
+
- 只传 `label`:渲染为普通上方标题
|
|
253
|
+
- 传 `label` + `material-label`:渲染为 Material 风格浮动标签
|
|
254
|
+
- 不传 `label`:保持原组件默认外观
|
|
255
|
+
|
|
256
|
+
Material 风格的上浮条件:
|
|
257
|
+
|
|
258
|
+
- 当前控件有值
|
|
259
|
+
- 当前控件有 placeholder
|
|
260
|
+
- 当前控件处于 focus / 打开状态(Select / SelectV2)
|
|
261
|
+
|
|
262
|
+
推荐写法:
|
|
263
|
+
|
|
264
|
+
```vue
|
|
265
|
+
<Input v-model="form.name" label="Name" />
|
|
266
|
+
<Input v-model="form.name" label="Material Name" material-label />
|
|
267
|
+
|
|
268
|
+
<Textarea v-model="form.remark" label="Remark" />
|
|
269
|
+
<Textarea v-model="form.remark" label="Material Remark" material-label />
|
|
270
|
+
|
|
271
|
+
<Select v-model="form.type" :options="options" label="Type" />
|
|
272
|
+
<Select
|
|
273
|
+
v-model="form.type"
|
|
274
|
+
:options="options"
|
|
275
|
+
label="Material Type"
|
|
276
|
+
material-label
|
|
277
|
+
/>
|
|
278
|
+
```
|
|
279
|
+
|
|
280
|
+
约束:
|
|
281
|
+
|
|
282
|
+
- Material label 的壳样式统一在 `src/style/chip/element.scss`,不要在业务组件里重复写一套 scoped 浮动 label
|
|
283
|
+
- 如果要做 Material 风格,优先直接使用 `label` + `material-label`,不要再额外包一层自定义标题
|
|
284
|
+
- 如需特殊背景色,优先通过 field surface 相关变量覆写,不要直接把 label 写死成固定背景色
|
|
285
|
+
|
|
241
286
|
## 7. 动画(ani.scss)
|
|
242
287
|
|
|
243
288
|
| 类名 | 用途 |
|
package/README.cn.md
CHANGED
|
@@ -220,6 +220,29 @@ await notify("需要发送到钉钉的消息");
|
|
|
220
220
|
- **组件 class 与单位**:根节点 `Mvc*` + 子命名 camelCase;组件内尺寸除 1px/2px 外建议 **rem**(根号 16px),与 `style-system.mdc` 一致。
|
|
221
221
|
- 工具函数、Store、路由在非 setup 场景(如守卫)中通过 **`globalThis`** 或 **`store` / `pinia` 导出**访问,与 `src/router/chip/guard.js` 用法一致。
|
|
222
222
|
|
|
223
|
+
## 表单 Label
|
|
224
|
+
|
|
225
|
+
`Input`、`Textarea`、`Select`、`SelectV2` 现已支持统一的 label 接口:
|
|
226
|
+
|
|
227
|
+
```vue
|
|
228
|
+
<Input v-model="form.name" label="Name" />
|
|
229
|
+
<Input v-model="form.name" label="Material Name" material-label />
|
|
230
|
+
|
|
231
|
+
<Textarea v-model="form.remark" label="Remark" />
|
|
232
|
+
<Textarea v-model="form.remark" label="Material Remark" material-label />
|
|
233
|
+
|
|
234
|
+
<Select v-model="form.type" :options="options" label="Type" />
|
|
235
|
+
<Select v-model="form.type" :options="options" label="Material Type" material-label />
|
|
236
|
+
```
|
|
237
|
+
|
|
238
|
+
规则:
|
|
239
|
+
|
|
240
|
+
- 只传 `label`:渲染普通上方标题
|
|
241
|
+
- 传 `label` + `material-label`:渲染 Material 风格浮动标签
|
|
242
|
+
- 不传 `label`:保持组件默认外观
|
|
243
|
+
|
|
244
|
+
浮动 label 的公共壳样式统一实现在 `src/style/chip/element.scss`。如果你希望表单控件呈现 Material 风格,优先直接使用 `label` + `material-label`,不要在业务侧再重复造一套浮动标题样式。
|
|
245
|
+
|
|
223
246
|
---
|
|
224
247
|
|
|
225
248
|
## 命令行:项目目录雏形(推荐)
|
package/README.md
CHANGED
|
@@ -207,6 +207,29 @@ Send messages with `globalThis.$notify.send("message")` or `import { notify } fr
|
|
|
207
207
|
- **CSS naming & units**: root `Mvc*`, children camelCase; prefer **rem** for sizes other than 1px/2px (16px root)—see `style-system.mdc`.
|
|
208
208
|
- Use **`globalThis`** or **`store` / `pinia` exports** outside `setup` (e.g. guards), as in `src/router/chip/guard.js`.
|
|
209
209
|
|
|
210
|
+
## Form Labels
|
|
211
|
+
|
|
212
|
+
`Input`, `Textarea`, `Select`, and `SelectV2` support a shared label API:
|
|
213
|
+
|
|
214
|
+
```vue
|
|
215
|
+
<Input v-model="form.name" label="Name" />
|
|
216
|
+
<Input v-model="form.name" label="Material Name" material-label />
|
|
217
|
+
|
|
218
|
+
<Textarea v-model="form.remark" label="Remark" />
|
|
219
|
+
<Textarea v-model="form.remark" label="Material Remark" material-label />
|
|
220
|
+
|
|
221
|
+
<Select v-model="form.type" :options="options" label="Type" />
|
|
222
|
+
<Select v-model="form.type" :options="options" label="Material Type" material-label />
|
|
223
|
+
```
|
|
224
|
+
|
|
225
|
+
Rules:
|
|
226
|
+
|
|
227
|
+
- `label` only: renders a normal top label
|
|
228
|
+
- `label` + `material-label`: renders a Material-style floating label
|
|
229
|
+
- no `label`: keeps the default control appearance
|
|
230
|
+
|
|
231
|
+
The floating label shell is implemented centrally in `src/style/chip/element.scss`. When you want a Material-style form field, prefer the built-in `label` + `material-label` API instead of recreating the same pattern locally.
|
|
232
|
+
|
|
210
233
|
---
|
|
211
234
|
|
|
212
235
|
## CLI: project skeleton
|
package/dist/vendor.js
CHANGED
|
@@ -7798,7 +7798,7 @@ const As = (e, o = {}) => {
|
|
|
7798
7798
|
}, Cs = {
|
|
7799
7799
|
name: "Matt Avias Frame",
|
|
7800
7800
|
copyright: "©2026",
|
|
7801
|
-
version: "1.0.
|
|
7801
|
+
version: "1.0.83",
|
|
7802
7802
|
author: "Matt Avias",
|
|
7803
7803
|
date: "2026-02-26",
|
|
7804
7804
|
/** 默认语言 key,与 `$getLang`、localStorage `lang` 一致;业务在 app.use(mvframe, { config }) 里覆盖 */
|
package/package.json
CHANGED
package/scripts/scaffold-app.js
CHANGED
|
@@ -867,6 +867,29 @@ yarn exec mvframe-d
|
|
|
867
867
|
|
|
868
868
|
\`src/main.js\` 已包含 \`import "mvframe/style"\` 与 \`import "mvframe/style/cpt"\`(分别对应工具类/变量与 **Mvc\*** 组件 scoped 等样式),一般 **无需** 在 \`index.scss\` 再引一遍 mvframe 的 dist CSS,以免重复。项目级覆盖写在 \`src/assets/style/index.scss\` 即可。
|
|
869
869
|
|
|
870
|
+
## 表单 Label
|
|
871
|
+
|
|
872
|
+
\`Input\`、\`Textarea\`、\`Select\`、\`SelectV2\` 支持统一的 label 接口:
|
|
873
|
+
|
|
874
|
+
\`\`\`vue
|
|
875
|
+
<Input v-model="form.name" label="Name" />
|
|
876
|
+
<Input v-model="form.name" label="Material Name" material-label />
|
|
877
|
+
|
|
878
|
+
<Textarea v-model="form.remark" label="Remark" />
|
|
879
|
+
<Textarea v-model="form.remark" label="Material Remark" material-label />
|
|
880
|
+
|
|
881
|
+
<Select v-model="form.type" :options="options" label="Type" />
|
|
882
|
+
<Select v-model="form.type" :options="options" label="Material Type" material-label />
|
|
883
|
+
\`\`\`
|
|
884
|
+
|
|
885
|
+
规则:
|
|
886
|
+
|
|
887
|
+
- 只传 \`label\`:渲染普通上方标题
|
|
888
|
+
- 传 \`label\` + \`material-label\`:渲染 Material 风格浮动标签
|
|
889
|
+
- 不传 \`label\`:保持组件默认外观
|
|
890
|
+
|
|
891
|
+
Material 风格 label 的公共壳样式统一在 \`src/style/chip/element.scss\`。如果你要做 Material 风格表单,优先直接使用 \`label\` + \`material-label\`,不要在业务侧再重复写一套浮动标题。
|
|
892
|
+
|
|
870
893
|
## 子路径(按需)
|
|
871
894
|
|
|
872
895
|
发布包 \`exports\` 还提供 \`mvframe/composition\`、\`mvframe/util\`、\`mvframe/store\`、\`mvframe/notify\` 等,业务侧可 \`import { ... } from "mvframe/composition"\` 等,参见包内 \`package.json\` 的 \`exports\`。
|