@@ -38,18 +38,25 @@ isComponent: true
3838
3939### ColorPicker Props
4040
41- | 名称 | 类型 | 默认值 | 说明 | 必传 |
42- | ------------- | ------- | --------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | ---- |
43- | enable-alpha | Boolean | false | 是否开启透明通道 | N |
44- | format | String | RGB | 格式化色值。` enableAlpha ` 为真时,` RGBA/HSLA/HSVA ` 等值有效。可选项:RGB/RGBA/HSL/HSLA/HSB/HSV/HSVA/HEX/CMYK/CSS | N |
45- | swatch-colors | Array | - | 系统预设的颜色样例,值为 ` null ` 或 ` [] ` 则不显示系统色,值为 ` undefined ` 会显示组件内置的系统默认色。TS 类型:` Array<string> \| null ` | N |
46- | type | String | base | 颜色选择器类型。(base 表示仅展示系统预设内容; multiple 表示展示色板和系统预设内容。。可选项:base/multiple。TS 类型:` TypeEnum ` ` type TypeEnum = 'base' \| 'multiple' ` 。[ 详细类型定义] ( https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/color-picker/type.ts ) | N |
47- | value | String | - | 色值 | N |
48- | default-value | String | undefined | 色值。非受控属性 | N |
41+ 名称 | 类型 | 默认值 | 描述 | 必传
42+ -- | -- | -- | -- | --
43+ style | Object | - | 样式 | N
44+ custom-style | Object | - | 样式,一般用于开启虚拟化组件节点场景 | N
45+ auto-close | Boolean | true | 自动关闭。在点击遮罩层时自动关闭,不需要手动设置 visible | N
46+ enable-alpha | Boolean | false | 是否开启透明通道 | N
47+ format | String | RGB | 格式化色值。` enableAlpha ` 为真时,` RGBA/HSLA/HSVA ` 等值有效。可选项:RGB/RGBA/HSL/HSLA/HSB/HSV/HSVA/HEX/CMYK/CSS | N
48+ popup-props | Object | {} | popupProps透传。TS 类型:` PopupProps ` ,[ Popup API Documents] ( ./popup?tab=api ) 。[ 详细类型定义] ( https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/color-picker/type.ts ) | N
49+ swatch-colors | Array | - | 系统预设的颜色样例,值为 ` null ` 或 ` [] ` 则不显示系统色,值为 ` undefined ` 会显示组件内置的系统默认色。TS 类型:` Array<string> \| null ` | N
50+ type | String | base | 颜色选择器类型。(base 表示仅展示系统预设内容; multiple 表示展示色板和系统预设内容。可选项:base/multiple。TS 类型:` TypeEnum ` ` type TypeEnum = 'base' \| 'multiple' ` 。[ 详细类型定义] ( https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/color-picker/type.ts ) | N
51+ use-popup | Boolean | false | 是否使用弹出层包裹颜色选择器 | N
52+ value | String | - | 色值 | N
53+ default-value | String | undefined | 色值。非受控属性 | N
54+ visible | Boolean | false | 是否显示颜色选择器。` usePopup ` 为 true 时有效 | N
4955
5056### ColorPicker Events
5157
52- | 名称 | 参数 | 描述 |
53- | ------------------ | ------------------------------------------------------------------------------------- | ----------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
54- | change | ` (value: string, context: { color: ColorObject; trigger: ColorPickerChangeTrigger }) ` | 选中的色值发生变化时触发,第一个参数 ` value ` 表示新色值,` context.color ` 表示当前调色板控制器的色值,` context.trigger ` 表示触发颜色变化的来源。[ 详细类型定义] ( https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/color-picker/type.ts ) 。<br />` type ColorPickerChangeTrigger = 'palette-hue-bar' \| 'palette-alpha-bar' \| 'preset' ` <br /> |
55- | palette-bar-change | ` (detail: { color: ColorObject }) ` | 调色板控制器的值变化时触发,` context.color ` 指调色板控制器的值。[ 详细类型定义] ( https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/color-picker/type.ts ) 。<br />` interface ColorObject { alpha: number; css: string; hex: string; hex8: string; hsl: string; hsla: string; hsv: string; hsva: string; rgb: string; rgba: string; value: number;} ` <br /> |
58+ 名称 | 参数 | 描述
59+ -- | -- | --
60+ change | ` (value: string, context: { color: ColorObject; trigger: ColorPickerChangeTrigger }) ` | 选中的色值发生变化时触发,第一个参数 ` value ` 表示新色值,` context.color ` 表示当前调色板控制器的色值,` context.trigger ` 表示触发颜色变化的来源。[ 详细类型定义] ( https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/color-picker/type.ts ) 。<br />` type ColorPickerChangeTrigger = 'palette-hue-bar' \| 'palette-alpha-bar' \| 'preset' ` <br />
61+ close | ` (trigger: ColorPickerTrigger) ` | 关闭按钮时触发。[ 详细类型定义] ( https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/color-picker/type.ts ) 。<br />` type ColorPickerTrigger = 'overlay' ` <br />
62+ palette-bar-change | ` (detail: { color: ColorObject }) ` | 调色板控制器的值变化时触发,` context.color ` 指调色板控制器的值。[ 详细类型定义] ( https://github.com/Tencent/tdesign-miniprogram/tree/develop/src/color-picker/type.ts ) 。<br />` interface ColorObject { alpha: number; css: string; hex: string; hex8: string; hsl: string; hsla: string; hsv: string; hsva: string; rgb: string; rgba: string; value: number;} ` <br />
0 commit comments