bug: 打印数量我为空的时候,不请求后台
This commit is contained in:
parent
526bfa65b5
commit
9e27d62e0e
@ -52,20 +52,20 @@
|
||||
honorMarginPadding: false,
|
||||
targetStyles: ['*'],
|
||||
style: `
|
||||
@page {
|
||||
size: ${widthInches}in ${heightInches}in;
|
||||
margin: 0;
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-size: 6px;
|
||||
}
|
||||
#barcodes-container canvas {
|
||||
display: block;
|
||||
margin-bottom: 2mm; /* 调整条形码之间的间距 */
|
||||
}
|
||||
`,
|
||||
@page {
|
||||
size: ${widthInches}in ${heightInches}in;
|
||||
margin: 0;
|
||||
}
|
||||
body {
|
||||
margin: 0;
|
||||
padding: 0;
|
||||
font-size: 6px;
|
||||
}
|
||||
#barcodes-container canvas {
|
||||
display: block;
|
||||
margin-bottom: 2mm; /* 调整条形码之间的间距 */
|
||||
}
|
||||
`,
|
||||
onLoadingStart: () => console.log('开始加载'),
|
||||
onLoadingEnd: () => console.log('加载完成'),
|
||||
// onError: (err: Error) => console.error('打印出错:', err),
|
||||
@ -80,6 +80,7 @@
|
||||
|
||||
// 定义一个函数来从后端获取条形码字符串并打印
|
||||
const fetchAndPrintBarcodes = (count: number) => {
|
||||
if (count <= 0) return
|
||||
// 清空之前的条形码容器
|
||||
const container = document.getElementById('barcodes-container')
|
||||
if (!container) throw new Error('条形码容器未找到')
|
||||
|
Loading…
x
Reference in New Issue
Block a user