打包
$ npm run build
发布
$ npm publish
安装
$ npm i id-card-read
导入
import { CVR100UA } from 'id-card-read';
cvrSrv: CVR100UA;
constructor() {
// 实例化
this.cvrSrv = new CVR100UA();
}
使用
use(): void {
设置button loading 防止频繁点击
if (this.loading === true) {
return;
}
this.loading = true;
this.cvrSrv.readCardProcess().then((res: any) => {
// res 身份证数据
console.log(res);
this.loading = false;
}).catch(e => {
this.loading = false;
});
}