perf: update skeleton
parent
df9ae4891a
commit
b65494c518
|
@ -95,11 +95,9 @@ const Skeleton = {
|
||||||
let avatarNode;
|
let avatarNode;
|
||||||
if (hasAvatar) {
|
if (hasAvatar) {
|
||||||
const avatarProps = {
|
const avatarProps = {
|
||||||
props: {
|
|
||||||
prefixCls: `${prefixCls}-avatar`,
|
prefixCls: `${prefixCls}-avatar`,
|
||||||
...getAvatarBasicProps(hasTitle, hasParagraph),
|
...getAvatarBasicProps(hasTitle, hasParagraph),
|
||||||
...getComponentProps(avatar),
|
...getComponentProps(avatar),
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
avatarNode = (
|
avatarNode = (
|
||||||
|
@ -115,11 +113,9 @@ const Skeleton = {
|
||||||
let $title;
|
let $title;
|
||||||
if (hasTitle) {
|
if (hasTitle) {
|
||||||
const titleProps = {
|
const titleProps = {
|
||||||
props: {
|
|
||||||
prefixCls: `${prefixCls}-title`,
|
prefixCls: `${prefixCls}-title`,
|
||||||
...getTitleBasicProps(hasAvatar, hasParagraph),
|
...getTitleBasicProps(hasAvatar, hasParagraph),
|
||||||
...getComponentProps(title),
|
...getComponentProps(title),
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
$title = <Title {...titleProps} />;
|
$title = <Title {...titleProps} />;
|
||||||
|
@ -129,11 +125,9 @@ const Skeleton = {
|
||||||
let paragraphNode;
|
let paragraphNode;
|
||||||
if (hasParagraph) {
|
if (hasParagraph) {
|
||||||
const paragraphProps = {
|
const paragraphProps = {
|
||||||
props: {
|
|
||||||
prefixCls: `${prefixCls}-paragraph`,
|
prefixCls: `${prefixCls}-paragraph`,
|
||||||
...getParagraphBasicProps(hasAvatar, hasTitle),
|
...getParagraphBasicProps(hasAvatar, hasTitle),
|
||||||
...getComponentProps(paragraph),
|
...getComponentProps(paragraph),
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
paragraphNode = <Paragraph {...paragraphProps} />;
|
paragraphNode = <Paragraph {...paragraphProps} />;
|
||||||
|
@ -159,8 +153,7 @@ const Skeleton = {
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
const children = this.$slots.default && this.$slots.default();
|
return this.$slots.default && this.$slots.default();
|
||||||
return children && children.length === 1 ? children[0] : <span>{children}</span>;
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
/* istanbul ignore next */
|
/* istanbul ignore next */
|
||||||
|
|
Loading…
Reference in New Issue