From 72141cb297ee556c50b6f1b7ce8e56965be9350b Mon Sep 17 00:00:00 2001 From: george-hong <15995610151@163.com> Date: Wed, 6 Mar 2024 00:18:42 +0800 Subject: [PATCH] =?UTF-8?q?fix:=20=E4=BF=AE=E5=A4=8D=E6=96=B0=E6=B7=BB?= =?UTF-8?q?=E5=8A=A0=E7=9A=84=E6=9D=A1=E5=BD=A2=E7=A0=81/=E4=BA=8C?= =?UTF-8?q?=E7=BB=B4=E7=A0=81=E5=85=83=E7=B4=A0-=E5=B7=A6=E5=8F=B3?= =?UTF-8?q?=E5=AF=B9=E9=BD=90=E5=8F=82=E6=95=B0=E4=B8=8D=E7=94=9F=E6=95=88?= =?UTF-8?q?=E7=9A=84=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/hiprint/hiprint.bundle.js | 14 +++++++++++--- 1 file changed, 11 insertions(+), 3 deletions(-) diff --git a/src/hiprint/hiprint.bundle.js b/src/hiprint/hiprint.bundle.js index 6cbcac0c..d4c9a089 100644 --- a/src/hiprint/hiprint.bundle.js +++ b/src/hiprint/hiprint.bundle.js @@ -2395,7 +2395,7 @@ var hiprint = function (t) { return null; }, t.prototype.createTarget = function () { - return this.target = $(`
\n
\n ${i18n.__('左右对齐')}\n
\n
\n \n
\n
`), this.target; + return this.target = $(`
\n
\n ${i18n.__('左右对齐')}\n
\n
\n \n
\n
`), this.target; }, t.prototype.getValue = function () { var t = this.target.find("select").val(); if (t) return t.toString(); @@ -9179,7 +9179,11 @@ var hiprint = function (t) { }) content.html($(barcode)) if (!this.options.hideTitle) { - content.append($(`
${ title ? title + ( text ? ":" : '' ) : "" }${ text }
`)) + const titleText = title ? title + ( text ? ':' : '' ) : ''; + const textAlign = this.options.textAlign || 'center'; + // 支持type为barcode的textAlign属性 + const textStyle = textAlign === 'justify' ? 'text-align-last: justify;text-justify: distribute-all-lines;' : `text-align: ${ textAlign };` + content.append($(`
${ titleText }${ text }
`)) } } catch (error) { console.error(error) @@ -9244,7 +9248,11 @@ var hiprint = function (t) { }) content.html($(qrcode)) if (!this.options.hideTitle) { - content.append($(`
${ title ? title + ( text ? ":" : '' ) : "" }${ text }
`)) + const titleText = title ? title + ( text ? ':' : '' ) : ''; + const textAlign = this.options.textAlign || 'center'; + // 支持type为qrcode的textAlign属性 + const textStyle = textAlign === 'justify' ? 'text-align-last: justify;text-justify: distribute-all-lines;' : `text-align: ${ textAlign };` + content.append($(`
${ titleText }${ text }
`)) } } catch (error) { console.error(error)