color-picker-plus
截图

Usage
<template>
<div class="w-[160px] mt-[50px] ml-[20px] ">
<ColorPicker @register="register" v-model:value="color">
</ColorPicker>
</div>
</template>
<script>
import {ColorPicker,useColor} from 'color-picker-plus';
const color= ref()
const[register]=useColor({
type:'hsl', //类型,在下面props里面有说明
disabled:true, //默认false
usuallyColorBlock:['#FF0000', '#55FF00', '#0015FF'], //常用的色块
defaultColor:'#f50' //默认选中颜色 可以为color
)
</script>
Props
| 属性 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| type | string | 'hsl' | 'hsl','hex','rgb','rgba' |
| usuallyColorBlock | string | Array[] | ['#FF0000', '#55FF00', '#0015FF'] |
| defaultColor | string | '' | '' |
| modalwidth | number | 300 | 颜色选择器弹出框的宽度 |
| disabled | boolean | false | 是否禁用 |
注意事项
- type跟defaultColor的类型保持一致
- type为‘hsl’defaultColor 为 'hsl(198,76%,36%)'
- type为‘rgb’defaultColor 为 'rgb(180,238,180)'
- type为‘rgba’defaultColor 为'rgb(192,255,62,0.5)'
- type为‘hex’defaultColor 为 '#00CDCD'
Install
npm i color-picker-plus
Related Packages
Version History
| Version | Released | Vue | License |
|---|---|---|---|
| 0.0.221 | ^3.2.33 | ||
| 0.0.33 | ^3.2.33 | ||
| 0.0.32 | ^3.2.33 | ||
| 0.0.31 | ^3.2.33 | ||
| 0.0.30 | ^3.2.33 | ||
| 0.0.29 | ^3.2.33 | ||
| 0.0.28 | ^3.2.33 | ||
| 0.0.27 | ^3.2.33 | ||
| 0.0.26 | ^3.2.33 | ||
| 0.0.25 | ^3.2.33 | ||
| 0.0.24 | ^3.2.33 | ||
| 0.0.23 | ^3.2.33 | ||
| 0.0.22 | ^3.2.33 | ||
| 0.0.21 | ^3.2.33 | ||
| 0.0.20 | ^3.2.33 | ||
| 0.0.19 | ^3.2.33 | ||
| 0.0.18 | ^3.2.33 | ||
| 0.0.16 | ^3.2.33 | ||
| 0.0.14 | ^3.2.45 | ||
| 0.0.13 | ^3.2.45 | ||
| 0.0.11 | ^3.2.45 | ||
| 0.0.10 | ^3.2.45 | ||
| 0.0.9 | ^3.2.45 | ||
| 0.0.8 | ^3.2.45 | ||
| 0.0.7 | ^3.2.45 | ||
| 0.0.6 | ^3.2.45 | ||
| 0.0.5 | ^3.2.45 | ||
| 0.0.4 | ^3.2.45 | ||
| 0.0.3 | ^3.2.45 | ||
| 0.0.2 | ^3.2.45 |
Showing the latest 30 of 31. See every release on npm