Skip to content

ColorPicker 颜色选择框

规则

js
{
    type: "ColorPicker",
    field: "color",
    title: "颜色",
    value: '#ff7271',
}
{
    type: "ColorPicker",
    field: "color",
    title: "颜色",
    value: '#ff7271',
}

参考:naive-ui_ColorPicker

value :String

Props

名称类型默认值说明版本
default-showbooleanundefined默认是否展示弹出层
default-valuestring | null和第一个 mode 对应的黑色值默认的颜色值
modesArray<'rgb' | 'hex' | 'hsl' | 'hsv'>['rgb', 'hex', 'hsl']颜色选择器支持颜色的格式,注意一旦你在某个模式下选择了值,颜色选择器值的格式将跟随这个格式
placement'top-start' | 'top' | 'top-end' | 'right-start' | 'right' | 'right-end' | 'bottom-start' | 'bottom' | 'bottom-end' | 'left-start' | 'left' | 'left-end' | 'bottom-start'面板的弹出位置2.25.0
render-label(color: string | null) => VNodeChildundefined触发器的内容2.24.0
showbooleanundefined是否展示面板
show-alphabooleantrue是否可调节 alpha 通道
show-previewbooleanfalse是否展示颜色预览块
size'small' | 'medium' | 'large''medium'颜色选择器的尺寸
disabledbooleanfalse是否禁用2.24.5
swatchesstring[]undefined色板的值
tostring | HTMLElement'body'面板的卸载位置
valuestring | nullundefined颜色选择器的值
on-complete(value: string) => voidundefined颜色完成改变后的回调(在鼠标移动时候不会调用)
on-update:show(value: boolean) => voidundefined面板可见状态改变的回调
on-update:value(value: string) => voidundefined颜色改变时的回调
actionsArray<'confirm'> | nullnull显示按钮

Released under the MIT License.