0.0.1 • Published 5 years ago
cc-color-picker v0.0.1
angular版 二维码组件cc-color-picker
安装
npm install cc-color-picker --save 或 yarn add cc-color-picker
使用
// 业务模块
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { FormsModule, ReactiveFormsModule } from '@angular/forms';
import { ColorPickerModule } from 'cc-color-picker';
import { AppComponent } from './app.component';
@NgModule({
declarations: [
AppComponent
],
imports: [
BrowserModule,
ColorPickerModule,
FormsModule,
ReactiveFormsModule
],
providers: [],
bootstrap: [AppComponent]
})
export class AppModule { }
//业务html
<div>
<cc-color-picker [(ngModel)]="selectColor"></cc-color-picker>
</div>
//业务组件
import { Component } from '@angular/core';
@Component({
selector: 'app-root',
templateUrl: './app.component.html',
styleUrls: ['./app.component.less']
})
export class AppComponent {
selectColor = '#00ff00';
}
参数
- style: 样式
- styleClass: CSS
- inline:是否内联
- format:分别是:hex、hsb、rgb,默认hex
- disabled:是否可用
- tabindex:TAB键在控件中的移动顺序
- inputId:Input的id
- 可通过ngModel双向绑定
- colorPickerChange:颜色改事件,返回颜色
0.0.1
5 years ago