Code Monkey home page Code Monkey logo

vue-color-picker's Introduction

vColorPicker

基于Vue的颜色选择器插件

DEMO 演示

安装

$ npm install vcolorpicker -S

使用

main.js 文件中引入插件并注册

# main.js
import vcolorpicker from 'vcolorpicker'
Vue.use(vcolorpicker)

在项目中使用 vcolorpicker

<template>
  <colorPicker v-model="color" />
</template>
<script>
  export default {
    data () {
      return {
        color: '#ff0000'
      }
    }
  }
</script>

特点

  1. 简单易用,UI在原插件基础上优化增加了圆角和过渡动画
  2. 提供以 npm 的形式安装提供全局组件
  3. 在支持 html5 input[type='color'] 的浏览器实现了「更多颜色」的功能

选项

你可以通过在所在的元素上设置以下属性来配置color-picker

  1. defaultColor:默认颜色,如defaultColor="#ff0000"
  2. disabled:禁用状态,如disabled=true

事件

change颜色值改变的时候触发

<colorPicker v-model="color" v-on:change="headleChangeColor" />

vue-color-picker's People

Contributors

zuley avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.