perf: update result

pull/2365/head^2
tanjinzhou 5 years ago
parent b65494c518
commit 1e35976bd1

@ -35,7 +35,7 @@ export const ResultProps = {
extra: PropTypes.any,
};
const renderIcon = (h, prefixCls, { status, icon }) => {
const renderIcon = (prefixCls, { status, icon }) => {
if (ExceptionStatus.includes(`${status}`)) {
const SVGComponent = ExceptionMap[status];
return (
@ -49,8 +49,7 @@ const renderIcon = (h, prefixCls, { status, icon }) => {
return <div class={`${prefixCls}-icon`}>{iconNode}</div>;
};
const renderExtra = (h, prefixCls, extra) =>
extra && <div class={`${prefixCls}-extra`}>{extra}</div>;
const renderExtra = (prefixCls, extra) => extra && <div class={`${prefixCls}-extra`}>{extra}</div>;
const Result = {
name: 'AResult',
@ -72,11 +71,11 @@ const Result = {
return (
<div class={`${prefixCls} ${prefixCls}-${status}`}>
{renderIcon(h, prefixCls, { status, icon })}
{renderIcon(prefixCls, { status, icon })}
<div class={`${prefixCls}-title`}>{title}</div>
{subTitle && <div class={`${prefixCls}-subtitle`}>{subTitle}</div>}
{this.$slots.default && <div class={`${prefixCls}-content`}>{this.$slots.default()}</div>}
{renderExtra(h, prefixCls, extra)}
{renderExtra(prefixCls, extra)}
</div>
);
},

Loading…
Cancel
Save