docs: accept ColorArea review and clarify proposal events

This commit is contained in:
maoyingjie
2026-10-27 07:38:36 +08:00
parent c56580e9b4
commit 6ece365168
3 changed files with 12 additions and 4 deletions
+3 -3
View File
@@ -141,12 +141,12 @@ ColorArea 组件使用以下 CSS 类([查看源码样式](https://github.com/h
| `class` | `string \| Array \| Object` | - | 附加 CSS 类(Vue class 绑定) |
| `style` | `StyleValue \| ((renderProps) => StyleValue)` | - | 行内样式或上游 style render prop;在组件基础样式之后合并 |
| `styleFn` | `(renderProps) => StyleValue` | - | 模板中的 style 函数别名;在基础样式和 `style` 之后合并 |
| `@update:modelValue` | `(color: Color \| null) => void` | - | 接受值变化;供 `v-model` 使用 |
| `@change` | `(color: Color \| null) => void` | - | 每次接受值变化时触发 |
| `@update:modelValue` | `(color: Color \| null) => void` | - | 提出颜色更新;供 `v-model` 使用 |
| `@change` | `(color: Color \| null) => void` | - | 提出不同于当前接受值的颜色时触发;受控父级可拒绝 |
| `@changeEnd` | `(color: Color \| null) => void` | - | 手势、键盘交互或失焦结束时触发一次;取消、卸载或外部替换不伪造完成事件 |
| 默认插槽 | `ColorAreaThumb` | - | 区域内的滑块;省略时没有可交互的原生轴 |
`changeEnd` 只在本次事务确有接受提案时触发,回调参数是最后一次提案。受控父级拒绝提案时,滑块、两个轴、背景和原生值都保持接受值,同一手势可以再次提案;取消指针、`lostpointercapture`、窗口失焦、禁用/只读切换、卸载和外部颜色替换只终止本控件事务,不取消兄弟控件的拖动。
`changeEnd` 只在本次事务确有颜色更新提案时触发(不要求受控父级接受),回调参数是最后一次提案。受控父级拒绝提案时,滑块、两个轴、背景和原生值都保持接受值,同一手势可以再次提案;取消指针、`lostpointercapture`、窗口失焦、禁用/只读切换、卸载和外部颜色替换只终止本控件事务,不取消兄弟控件的拖动。
省略全部 `modelValue`/`value`/`defaultValue` 时会继承最近的共享颜色 owner(当前私有组合与后续公开颜色组件使用同一协议);显式值覆盖继承,显式 `null` 清空接受值并用默认色绘制区域。空字符串和无效颜色不是“清空”:它们按 `parseColor` 边界抛出 `RangeError`。