SuperAPI AI 工具集

el-color-picker

通用与其它

查看项目

更新于 10-15 23:32

技能介绍

用途:Element Plus 提供的 ColorPicker 颜色选择器组件,用于颜色选择,适用于主题定制、颜色选择、设计工具和样式配置等场景。

主要能力:支持多种颜色格式;可通过 show-alpha 显示透明度滑块;通过 predefine 设置预定义颜色;通过 size 设置尺寸(large、default、small);通过 color-format 指定颜色格式,可选 rgb、prgb、hex、hex3、hex4、hex6、hex8、name、hsl、hsv。

基本用法:使用 v-model 绑定颜色值,例如 <el-color-picker v-model="color" />。开启透明度使用 show-alpha;预定义颜色传入 predefine 数组;指定格式使用 color-format,如 color-format="rgb"。

属性:model-value / v-model 为绑定值(string);disabled 禁用(boolean,默认 false);clearable 显示清除按钮(boolean,默认 true);size 尺寸;show-alpha 显示透明度滑块(boolean,默认 false);color-format 颜色格式(默认 hex 或 rgb);predefine 预定义颜色(string[]);validate-event 触发表单验证(boolean,默认 true)。

事件:change 值变化;active-change 活动颜色变化;focus 聚焦;blur 失焦;clear 点击清除按钮。

暴露方法:color 当前颜色对象;show 显示选择器;hide 隐藏选择器;focus 聚焦选择器;blur 失焦选择器。

最佳实践:需要透明色时使用 show-alpha;品牌色使用 predefine;特定格式需求使用 color-format。

限制:资料未提供安装命令、版本要求、浏览器兼容性及收费信息。