mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-25 03:29:59 +08:00
fix: Skeleton missing style (#33405)
This commit is contained in:
parent
0edf04253e
commit
9c086c5328
@ -17,6 +17,7 @@ export interface SkeletonProps {
|
|||||||
loading?: boolean;
|
loading?: boolean;
|
||||||
prefixCls?: string;
|
prefixCls?: string;
|
||||||
className?: string;
|
className?: string;
|
||||||
|
style?: React.CSSProperties;
|
||||||
children?: React.ReactNode;
|
children?: React.ReactNode;
|
||||||
avatar?: SkeletonAvatarProps | boolean;
|
avatar?: SkeletonAvatarProps | boolean;
|
||||||
title?: SkeletonTitleProps | boolean;
|
title?: SkeletonTitleProps | boolean;
|
||||||
@ -76,6 +77,7 @@ const Skeleton = (props: SkeletonProps) => {
|
|||||||
prefixCls: customizePrefixCls,
|
prefixCls: customizePrefixCls,
|
||||||
loading,
|
loading,
|
||||||
className,
|
className,
|
||||||
|
style,
|
||||||
children,
|
children,
|
||||||
avatar,
|
avatar,
|
||||||
title,
|
title,
|
||||||
@ -153,7 +155,7 @@ const Skeleton = (props: SkeletonProps) => {
|
|||||||
);
|
);
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<div className={cls}>
|
<div className={cls} style={style}>
|
||||||
{avatarNode}
|
{avatarNode}
|
||||||
{contentNode}
|
{contentNode}
|
||||||
</div>
|
</div>
|
||||||
|
@ -526,6 +526,31 @@ exports[`Skeleton should square avatar 1`] = `
|
|||||||
</div>
|
</div>
|
||||||
`;
|
`;
|
||||||
|
|
||||||
|
exports[`Skeleton should support style 1`] = `
|
||||||
|
<div
|
||||||
|
class="ant-skeleton"
|
||||||
|
style="background: blue;"
|
||||||
|
>
|
||||||
|
<div
|
||||||
|
class="ant-skeleton-content"
|
||||||
|
>
|
||||||
|
<h3
|
||||||
|
class="ant-skeleton-title"
|
||||||
|
style="width: 38%;"
|
||||||
|
/>
|
||||||
|
<ul
|
||||||
|
class="ant-skeleton-paragraph"
|
||||||
|
>
|
||||||
|
<li />
|
||||||
|
<li />
|
||||||
|
<li
|
||||||
|
style="width: 61%;"
|
||||||
|
/>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
`;
|
||||||
|
|
||||||
exports[`Skeleton should without avatar and paragraph 1`] = `
|
exports[`Skeleton should without avatar and paragraph 1`] = `
|
||||||
<div
|
<div
|
||||||
class="ant-skeleton"
|
class="ant-skeleton"
|
||||||
|
@ -147,4 +147,9 @@ describe('Skeleton', () => {
|
|||||||
expect(wrapper.render()).toMatchSnapshot();
|
expect(wrapper.render()).toMatchSnapshot();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
|
||||||
|
it('should support style', () => {
|
||||||
|
const wrapper = genSkeleton({ style: { background: 'blue' } });
|
||||||
|
expect(wrapper.render()).toMatchSnapshot();
|
||||||
|
});
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user