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 diff --git a/src/qr-code/src/QrCode.tsx b/src/qr-code/src/QrCode.tsx index 364bc44f92a..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}px`, - height: `${size}px`, + width: `${size + padding * 2}px`, + height: `${size + padding * 2}px`, ...cssVars }} >