Giter VIP home page Giter VIP logo

cc-qrcode-demo's Introduction

angular版 二维码组件cc-qrcode

安装

npm install cc-qrcode --save 或 yarn add cc-qrcode

使用

// 业务模块
import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';
import { QrcodeModule } from 'cc-qrcode';

import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    QrcodeModule
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

//业务html
<div>
  <cc-qrcode [value]="'123456789'"></cc-qrcode>
</div>

参数

  1. value:二维码值

  2. background:背景颜色,默认白色

  3. foreground:前景颜色,默认黑色

  4. backgroundAlpha:背景透明度

  5. foregroundAlpha:前景透明度

  6. level:二维码级别,默认L

  7. mime:生成的图片类型,默认image/png

  8. padding:内边距

  9. size:二维码大小(宽高)

  10. canvas:是否使用画布生成,默认为false,图片方式

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.