|
1 | 1 | import type { VNodeTypes, PropType, VNode, ExtractPropTypes, CSSProperties } from 'vue';
|
2 | 2 | import { isVNode, defineComponent, renderSlot } from 'vue';
|
3 | 3 | import Tabs from '../tabs';
|
4 |
| -import Row from '../row'; |
5 |
| -import Col from '../col'; |
6 | 4 | import PropTypes from '../_util/vue-types';
|
7 | 5 | import { flattenChildren, isEmptyElement, filterEmptyWithUndefined } from '../_util/props-util';
|
8 | 6 | import type { SizeType } from '../config-provider';
|
9 | 7 | import isPlainObject from 'lodash-es/isPlainObject';
|
10 | 8 | import useConfigInject from '../config-provider/hooks/useConfigInject';
|
11 | 9 | import devWarning from '../vc-util/devWarning';
|
12 | 10 | import useStyle from './style';
|
| 11 | +import Skeleton from '../skeleton'; |
13 | 12 | export interface CardTabListType {
|
14 | 13 | key: string;
|
15 | 14 | tab: any;
|
@@ -112,34 +111,10 @@ const Card = defineComponent({
|
112 | 111 | [`${pre}-type-${type}`]: !!type,
|
113 | 112 | [`${pre}-rtl`]: direction.value === 'rtl',
|
114 | 113 | };
|
115 |
| - |
116 |
| - const loadingBlockStyle = |
117 |
| - bodyStyle.padding === 0 || bodyStyle.padding === '0px' ? { padding: '24px' } : undefined; |
118 |
| - |
119 |
| - const block = <div class={`${pre}-loading-block`} />; |
120 | 114 | const loadingBlock = (
|
121 |
| - <div class={`${pre}-loading-content`} style={loadingBlockStyle}> |
122 |
| - <Row gutter={8}> |
123 |
| - <Col span={22}>{block}</Col> |
124 |
| - </Row> |
125 |
| - <Row gutter={8}> |
126 |
| - <Col span={8}>{block}</Col> |
127 |
| - <Col span={15}>{block}</Col> |
128 |
| - </Row> |
129 |
| - <Row gutter={8}> |
130 |
| - <Col span={6}>{block}</Col> |
131 |
| - <Col span={18}>{block}</Col> |
132 |
| - </Row> |
133 |
| - <Row gutter={8}> |
134 |
| - <Col span={13}>{block}</Col> |
135 |
| - <Col span={9}>{block}</Col> |
136 |
| - </Row> |
137 |
| - <Row gutter={8}> |
138 |
| - <Col span={4}>{block}</Col> |
139 |
| - <Col span={3}>{block}</Col> |
140 |
| - <Col span={16}>{block}</Col> |
141 |
| - </Row> |
142 |
| - </div> |
| 115 | + <Skeleton loading active paragraph={{ rows: 4 }} title={false}> |
| 116 | + {children} |
| 117 | + </Skeleton> |
143 | 118 | );
|
144 | 119 |
|
145 | 120 | const hasActiveTabKey = activeTabKey !== undefined;
|
@@ -195,7 +170,7 @@ const Card = defineComponent({
|
195 | 170 | actions && actions.length ? <ul class={`${pre}-actions`}>{getAction(actions)}</ul> : null;
|
196 | 171 |
|
197 | 172 | return wrapSSR(
|
198 |
| - <div ref="cardContainerRef" {...attrs} class={classString}> |
| 173 | + <div ref="cardContainerRef" {...attrs} class={[classString, attrs.class]}> |
199 | 174 | {head}
|
200 | 175 | {coverDom}
|
201 | 176 | {children && children.length ? body : null}
|
|
0 commit comments