mirror of
https://github.com/tusen-ai/naive-ui.git
synced 2024-11-27 04:09:51 +08:00
fix(n-result): show icons on re-render after hydration (#5686)
* fix(n-result): show icons on re-render after hydration * refactor: change iconMap name --------- Co-authored-by: 07akioni <07akioni2@gmail.com>
This commit is contained in:
parent
b6c4be771e
commit
53ebcbe6d5
@ -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
|
||||
|
||||
|
@ -5,6 +5,7 @@
|
||||
### Fixes
|
||||
|
||||
- 修复 `n-split` 的 `min` 属性未生效
|
||||
- Fix `n-result` built-in icons not re-rendered after hydration.
|
||||
|
||||
### Features
|
||||
|
||||
|
@ -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: <InfoIcon />,
|
||||
success: <SuccessIcon />,
|
||||
warning: <WarningIcon />,
|
||||
error: <ErrorIcon />
|
||||
const iconRenderMap = {
|
||||
403: () => image403,
|
||||
404: () => image404,
|
||||
418: () => image418,
|
||||
500: () => image500,
|
||||
info: () => <InfoIcon />,
|
||||
success: () => <SuccessIcon />,
|
||||
warning: () => <WarningIcon />,
|
||||
error: () => <ErrorIcon />
|
||||
}
|
||||
|
||||
export const resultProps = {
|
||||
@ -130,7 +130,7 @@ export default defineComponent({
|
||||
<div class={`${mergedClsPrefix}-result-icon`}>
|
||||
{$slots.icon?.() || (
|
||||
<NBaseIcon clsPrefix={mergedClsPrefix}>
|
||||
{{ default: () => iconMap[status] }}
|
||||
{{ default: () => iconRenderMap[status]() }}
|
||||
</NBaseIcon>
|
||||
)}
|
||||
</div>
|
||||
|
Loading…
Reference in New Issue
Block a user