0.0.9 • Published 6 months ago

mx-color-picker v0.0.9

Weekly downloads
-
License
MIT
Repository
-
Last release
6 months ago

colorpicker

A very beautiful color picker, supports input and output of multiple color formats, and supports gradient color selection.

一个非常漂亮的颜色选择器,支持多种颜色格式的输入和输出,并支持渐变色选择。

Installation

npm install mx-color-picker

How to use

The first step is global registration

import MxColorPicker from "mx-color-picker";
import "mx-color-picker/style.css";

createApp(App)
  .use(router)
  .use(MxColorPicker)
  .mount("#app");

OR

import { ColorPicker } from "mx-color-picker";
import "mx-color-picker/style.css";

export default defineComponent({
components: { ColorPicker },
});

Usage

<template>
  <div>
     <color-picker v-model:pureColor="pureColor" v-model:gradientColor="gradientColor"/>
  </div>
</template>
<script lang="ts">
  import { ref } from "vue";

  export default defineComponent({
     setup() {
       const pureColor = ref("red");
       const gradientColor = ref("linear-gradient(0deg, rgba(0, 0, 0, 1) 0%, rgba(0, 0, 0, 1) 100%)");

       return { pureColor, gradientColor }
     }
  });
</script>

参数配置

参数值描述选项默认值
isWidget是否为弹出层组件?true / falsefalse
shape形状circle / squaresquare
pureColor纯色默认值--
gradientColor渐变色默认值--
pickerType色块/渐变区域fk / chromefk
useType纯色/渐变/全部pure / gradient / bothpure
disableHistory禁用历史色值true / falsefalse
roundHistory历史色值形状圆形true / falsefalse
disableAlpha禁用透明度选项true / falsefalse
zIndex层级数值类型-
lang语言ZH-cn / EnZH-cn
pickerContainer挂载元素元素名称body
debounce防抖时间数值类型-
theme主题white / blackwhite
0.0.9

6 months ago

0.0.8

6 months ago

0.0.7

6 months ago

0.0.6

6 months ago

0.0.5

6 months ago

0.0.4

6 months ago