更正前端内容

This commit is contained in:
2026-01-09 15:15:40 +08:00
parent 66917cb85a
commit bcfe3ff273

View File

@@ -131,17 +131,16 @@ export default {
const finalCanvasHeight = containerHeight * printScale;
// 使用合适的scale值生成高清Canvas但不超过纸张尺寸
const canvasScale = Math.min(1.5, printScale * 1.5); // 确保不超过纸张
const canvasScale = Math.min(2, printScale * 2); // 适当提高清晰度
// 4. 用html2canvas生成高清Canvas解决文字模糊+二维码丢失)
// 注意:不再强制指定 width/height避免裁掉最右/最下边框
const canvas = await html2canvas(labelContainer, {
scale: canvasScale,
backgroundColor: '#ffffff', // 强制白色背景,避免打印时背景透明
useCORS: true, // 支持跨域图片
allowTaint: true, // 允许渲染canvas二维码
taintTest: false, // 关闭canvas污染检测
width: containerWidth,
height: containerHeight,
logging: false,
});