Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/myopenresources/cc-qrcode-demo
https://github.com/myopenresources/cc-qrcode-demo
angular angular8 qrcode
Last synced: about 1 month ago
JSON representation
- Host: GitHub
- URL: https://github.com/myopenresources/cc-qrcode-demo
- Owner: myopenresources
- License: mit
- Created: 2019-07-14T03:16:07.000Z (over 5 years ago)
- Default Branch: master
- Last Pushed: 2023-01-07T08:42:33.000Z (about 2 years ago)
- Last Synced: 2024-11-06T05:20:47.278Z (3 months ago)
- Topics: angular, angular8, qrcode
- Language: TypeScript
- Size: 3.23 MB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 29
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# angular版 二维码组件cc-qrcode
## 安装
npm install cc-qrcode --save 或 yarn add cc-qrcode## 使用
```javascript
// 业务模块
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
```
## 参数
1. value:二维码值2. background:背景颜色,默认白色
3. foreground:前景颜色,默认黑色
4. backgroundAlpha:背景透明度
5. foregroundAlpha:前景透明度
6. level:二维码级别,默认L
7. mime:生成的图片类型,默认image/png
8. padding:内边距
9. size:二维码大小(宽高)
10. canvas:是否使用画布生成,默认为false,图片方式