From 39966c13cf62b42291fd5a44a7f95e046aab392d Mon Sep 17 00:00:00 2001 From: smileluck <12386904+smileluck@users.noreply.github.com> Date: Thu, 12 Dec 2024 10:49:23 +0800 Subject: [PATCH 1/4] fix: qr-code/src/QrCode.tsx padding and size error --- src/qr-code/src/QrCode.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qr-code/src/QrCode.tsx b/src/qr-code/src/QrCode.tsx index 364bc44f92a..9f82507eb0d 100644 --- a/src/qr-code/src/QrCode.tsx +++ b/src/qr-code/src/QrCode.tsx @@ -337,8 +337,8 @@ export default defineComponent({ style={{ padding: typeof padding === 'number' ? `${padding}px` : padding, backgroundColor, - width: `${size}px`, - height: `${size}px`, + width: `${size + padding}px`, + height: `${size + padding}px`, ...cssVars }} > From 2890b4d5c57f3fd5a62cdea2103d474671e5107d Mon Sep 17 00:00:00 2001 From: smileluck <12386904+smileluck@users.noreply.github.com> Date: Thu, 12 Dec 2024 10:56:52 +0800 Subject: [PATCH 2/4] chore: Supplementary statement --- CHANGELOG.en-US.md | 1 + CHANGELOG.zh-CN.md | 1 + 2 files changed, 2 insertions(+) diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index 4da53bc65a1..44f6b731213 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -5,6 +5,7 @@ `2024-12-02` - Fix marquee is not exported with correct name. +- Fixed 'n-qr-code' size 'attribute not adding' paddding 'attribute, resulting in an issue with the actual width of the graph ## 2.40.2 diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index 163dc6a4934..7c88f4b4631 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -5,6 +5,7 @@ `2024-12-02` - 修复 marquee 没有被用正确的名字导出 +- 修复 `n-qr-code` `size` 属性没有累加 `paddding` 属性,导致图形实际宽度有问题 ## 2.40.2 From 82db7afb5c6e9c900b2b13fc560ddb907c0c1839 Mon Sep 17 00:00:00 2001 From: smileluck <12386904+smileluck@users.noreply.github.com> Date: Thu, 12 Dec 2024 11:54:03 +0800 Subject: [PATCH 3/4] fix: qr-code/src/QrCode.tsx padding and size error --- src/qr-code/src/QrCode.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qr-code/src/QrCode.tsx b/src/qr-code/src/QrCode.tsx index 9f82507eb0d..13947c67eb4 100644 --- a/src/qr-code/src/QrCode.tsx +++ b/src/qr-code/src/QrCode.tsx @@ -337,8 +337,8 @@ export default defineComponent({ style={{ padding: typeof padding === 'number' ? `${padding}px` : padding, backgroundColor, - width: `${size + padding}px`, - height: `${size + padding}px`, + width: `${size - padding * 2}px`, + height: `${size - padding * 2}px`, ...cssVars }} > From bb0a65960446f82cb1a5d92a85a901a5be12c1bb Mon Sep 17 00:00:00 2001 From: smileluck <12386904+smileluck@users.noreply.github.com> Date: Thu, 12 Dec 2024 11:54:03 +0800 Subject: [PATCH 4/4] fix: qr-code/src/QrCode.tsx padding and size error --- src/qr-code/src/QrCode.tsx | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/qr-code/src/QrCode.tsx b/src/qr-code/src/QrCode.tsx index 9f82507eb0d..d36815747fb 100644 --- a/src/qr-code/src/QrCode.tsx +++ b/src/qr-code/src/QrCode.tsx @@ -337,8 +337,8 @@ export default defineComponent({ style={{ padding: typeof padding === 'number' ? `${padding}px` : padding, backgroundColor, - width: `${size + padding}px`, - height: `${size + padding}px`, + width: `${size + padding * 2}px`, + height: `${size + padding * 2}px`, ...cssVars }} >