Skip to content

Commit

Permalink
build(二维码): 构建失败修复
Browse files Browse the repository at this point in the history
  • Loading branch information
nihaojob committed Jun 7, 2024
1 parent 2d9eccc commit ea128af
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions packages/core/plugin/BarCodePlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,14 @@
* @Author: 秦少卫
* @Date: 2024-06-06 14:12:24
* @LastEditors: 秦少卫
* @LastEditTime: 2024-06-07 11:44:54
* @LastEditTime: 2024-06-07 11:53:04
* @Description: 条形码生成工具
*/

import { fabric } from 'fabric';
import Editor from '../Editor';
import 'JsBarcode';
import * as JsBarcode from 'JsBarcode';

type IEditor = Editor;

// 条形码生成参数
Expand All @@ -35,7 +36,7 @@ class BarCodePlugin {

_getBase64Str(option: any) {
const canvas = document.createElement('canvas');
window.JsBarcode(canvas, option.value, {
JsBarcode(canvas, option.value, {
...option,
});
const url = canvas.toDataURL('image/png', 1);
Expand Down

0 comments on commit ea128af

Please sign in to comment.