diff --git a/CHANGELOG.en-US.md b/CHANGELOG.en-US.md index eb5d3ca65..e8523d07b 100644 --- a/CHANGELOG.en-US.md +++ b/CHANGELOG.en-US.md @@ -5,6 +5,7 @@ ### Fixes - Fix `n-split`'s `min` attribute does not take effect +- Fix `n-result` built-in icons not re-rendered after hydration. ### Features diff --git a/CHANGELOG.zh-CN.md b/CHANGELOG.zh-CN.md index a749db2df..ca806a0fa 100644 --- a/CHANGELOG.zh-CN.md +++ b/CHANGELOG.zh-CN.md @@ -5,6 +5,7 @@ ### Fixes - 修复 `n-split` 的 `min` 属性未生效 +- Fix `n-result` built-in icons not re-rendered after hydration. ### Features diff --git a/src/result/src/Result.tsx b/src/result/src/Result.tsx index 2c8f453fe..6fb4ba6a6 100644 --- a/src/result/src/Result.tsx +++ b/src/result/src/Result.tsx @@ -24,15 +24,15 @@ import image418 from './418' import image403 from './403' import style from './styles/index.cssr' -const iconMap = { - 403: image403, - 404: image404, - 418: image418, - 500: image500, - info: , - success: , - warning: , - error: +const iconRenderMap = { + 403: () => image403, + 404: () => image404, + 418: () => image418, + 500: () => image500, + info: () => , + success: () => , + warning: () => , + error: () => } export const resultProps = { @@ -130,7 +130,7 @@ export default defineComponent({
{$slots.icon?.() || ( - {{ default: () => iconMap[status] }} + {{ default: () => iconRenderMap[status]() }} )}