@ans1998/vue3-color

Color of Vue 3 Components
4,250 1
Install
npm install @ans1998/vue3-color
Latest Version:3.0.7
Vue:3
License:MIT
Last Updated:Jul 7, 2022
Links: GitHub  ·  npm
Maintainer: ans1998

vue3-color

Color Pickers for Sketch, Photoshop, Chrome & more with Vue 3.

This package bring Vue 3 support to original package : vue-color

Live demo

intro

Installation

NPM

$ npm i @ans1998/vue3-color

使用


<div>
  <h2>Sketch</h2>
  <div style="width: 40px; height: 40px; cursor: pointer" :style="{backgroundColor: sketchBgColor}" @click="changSketch"></div>
  <Sketch v-model="colors" :show="showSketch" @changButton="changSketchButton"></Sketch>
</div>

import { Sketch } from '@ans1998/vue3-color'

/** 
let item = {
    isOk: true,
    activeColor: '',
    hex: ''
}
*/
components: {
  Sketch
}

data () {
  return {
    colors: "",
    sketchBgColor: "#222",
    showSketch: true
  }
}

changSketchButton (item) {
  this.showSketch = false
  console.log(item)
  if (item.isOk) {
    console.log('确定')
    this.sketchBgColor = item.activeColor
  } else {
    console.log('取消')
  }
}

ts

shims-vue.d.ts
/* eslint-disable */
declare module '*.vue' {
  import type, { DefineComponent } from 'vue'
  const component: DefineComponent<{}, {}, any>
  export default component
}
declare module '@ans1998/vue3-color'

说明

基于@lk77的项目进行二开

License

@ans1998/vue3-color is licensed under The MIT License.

Related Packages

@lk77/vue3-color

Color of Vue 3 Components

1,515,677 24
@apostrophecms/vue-color

Fork of vue-color that allows null values

9,228 0
vue-color-sketch

Color of Vue Components

1,882
@ckpack/vue-color

(vue3.0) 🎨 Vue Color Pickers for Sketch, Photoshop, Chrome & more

4,440,283 188
v-pagination-3

Vue.js 3 pagination component

823,217 186

Version History

Version Released Vue License
3.0.7 ^3.2.31 MIT
3.0.6 ^3.2.31 MIT