mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-08 01:53:34 +08:00
Remove extra wrapper of Card
This commit is contained in:
parent
ed44dfaeb8
commit
2e45074fab
@ -5,7 +5,6 @@ exports[`renders ./components/card/demo/basic.md correctly 1`] = `
|
||||
class="ant-card ant-card-bordered"
|
||||
style="width:300px"
|
||||
>
|
||||
<div>
|
||||
<div
|
||||
class="ant-card-head"
|
||||
>
|
||||
@ -44,7 +43,6 @@ exports[`renders ./components/card/demo/basic.md correctly 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`renders ./components/card/demo/border-less.md correctly 1`] = `
|
||||
@ -55,7 +53,6 @@ exports[`renders ./components/card/demo/border-less.md correctly 1`] = `
|
||||
class="ant-card"
|
||||
style="width:300px"
|
||||
>
|
||||
<div>
|
||||
<div
|
||||
class="ant-card-head"
|
||||
>
|
||||
@ -86,7 +83,6 @@ exports[`renders ./components/card/demo/border-less.md correctly 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`renders ./components/card/demo/flexible-content.md correctly 1`] = `
|
||||
@ -94,7 +90,6 @@ exports[`renders ./components/card/demo/flexible-content.md correctly 1`] = `
|
||||
class="ant-card ant-card-bordered ant-card-hoverable"
|
||||
style="width:240px"
|
||||
>
|
||||
<div>
|
||||
<div
|
||||
class="ant-card-cover"
|
||||
>
|
||||
@ -132,14 +127,12 @@ exports[`renders ./components/card/demo/flexible-content.md correctly 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`renders ./components/card/demo/grid-card.md correctly 1`] = `
|
||||
<div
|
||||
class="ant-card ant-card-bordered ant-card-contain-grid"
|
||||
>
|
||||
<div>
|
||||
<div
|
||||
class="ant-card-head"
|
||||
>
|
||||
@ -202,7 +195,6 @@ exports[`renders ./components/card/demo/grid-card.md correctly 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`renders ./components/card/demo/in-column.md correctly 1`] = `
|
||||
@ -220,7 +212,6 @@ exports[`renders ./components/card/demo/in-column.md correctly 1`] = `
|
||||
<div
|
||||
class="ant-card"
|
||||
>
|
||||
<div>
|
||||
<div
|
||||
class="ant-card-head"
|
||||
>
|
||||
@ -243,7 +234,6 @@ exports[`renders ./components/card/demo/in-column.md correctly 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ant-col-8"
|
||||
style="padding-left:8px;padding-right:8px"
|
||||
@ -251,7 +241,6 @@ exports[`renders ./components/card/demo/in-column.md correctly 1`] = `
|
||||
<div
|
||||
class="ant-card"
|
||||
>
|
||||
<div>
|
||||
<div
|
||||
class="ant-card-head"
|
||||
>
|
||||
@ -274,7 +263,6 @@ exports[`renders ./components/card/demo/in-column.md correctly 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ant-col-8"
|
||||
style="padding-left:8px;padding-right:8px"
|
||||
@ -282,7 +270,6 @@ exports[`renders ./components/card/demo/in-column.md correctly 1`] = `
|
||||
<div
|
||||
class="ant-card"
|
||||
>
|
||||
<div>
|
||||
<div
|
||||
class="ant-card-head"
|
||||
>
|
||||
@ -307,14 +294,12 @@ exports[`renders ./components/card/demo/in-column.md correctly 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`renders ./components/card/demo/inner.md correctly 1`] = `
|
||||
<div
|
||||
class="ant-card ant-card-bordered"
|
||||
>
|
||||
<div>
|
||||
<div
|
||||
class="ant-card-head"
|
||||
>
|
||||
@ -340,7 +325,6 @@ exports[`renders ./components/card/demo/inner.md correctly 1`] = `
|
||||
<div
|
||||
class="ant-card ant-card-bordered ant-card-type-inner"
|
||||
>
|
||||
<div>
|
||||
<div
|
||||
class="ant-card-head"
|
||||
>
|
||||
@ -371,12 +355,10 @@ exports[`renders ./components/card/demo/inner.md correctly 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<div
|
||||
class="ant-card ant-card-bordered ant-card-type-inner"
|
||||
style="margin-top:16px"
|
||||
>
|
||||
<div>
|
||||
<div
|
||||
class="ant-card-head"
|
||||
>
|
||||
@ -410,8 +392,6 @@ exports[`renders ./components/card/demo/inner.md correctly 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`renders ./components/card/demo/loading.md correctly 1`] = `
|
||||
@ -419,7 +399,6 @@ exports[`renders ./components/card/demo/loading.md correctly 1`] = `
|
||||
class="ant-card ant-card-loading ant-card-bordered"
|
||||
style="width:34%"
|
||||
>
|
||||
<div>
|
||||
<div
|
||||
class="ant-card-head"
|
||||
>
|
||||
@ -490,7 +469,6 @@ exports[`renders ./components/card/demo/loading.md correctly 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`renders ./components/card/demo/meta.md correctly 1`] = `
|
||||
@ -498,7 +476,6 @@ exports[`renders ./components/card/demo/meta.md correctly 1`] = `
|
||||
class="ant-card ant-card-bordered"
|
||||
style="width:300px"
|
||||
>
|
||||
<div>
|
||||
<div
|
||||
class="ant-card-cover"
|
||||
>
|
||||
@ -546,7 +523,6 @@ exports[`renders ./components/card/demo/meta.md correctly 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<ul
|
||||
class="ant-card-actions"
|
||||
>
|
||||
@ -586,7 +562,6 @@ exports[`renders ./components/card/demo/simple.md correctly 1`] = `
|
||||
class="ant-card ant-card-bordered"
|
||||
style="width:300px"
|
||||
>
|
||||
<div>
|
||||
<div
|
||||
class="ant-card-body"
|
||||
>
|
||||
@ -603,7 +578,6 @@ exports[`renders ./components/card/demo/simple.md correctly 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
||||
exports[`renders ./components/card/demo/tabs.md correctly 1`] = `
|
||||
@ -612,7 +586,6 @@ exports[`renders ./components/card/demo/tabs.md correctly 1`] = `
|
||||
class="ant-card ant-card-bordered ant-card-contain-tabs"
|
||||
style="width:100%"
|
||||
>
|
||||
<div>
|
||||
<div
|
||||
class="ant-card-head"
|
||||
>
|
||||
@ -721,14 +694,12 @@ exports[`renders ./components/card/demo/tabs.md correctly 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
<br />
|
||||
<br />
|
||||
<div
|
||||
class="ant-card ant-card-bordered ant-card-contain-tabs"
|
||||
style="width:100%"
|
||||
>
|
||||
<div>
|
||||
<div
|
||||
class="ant-card-head"
|
||||
>
|
||||
@ -836,5 +807,4 @@ exports[`renders ./components/card/demo/tabs.md correctly 1`] = `
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
</div>
|
||||
`;
|
||||
|
@ -183,13 +183,6 @@ export default class Card extends React.Component<CardProps, {}> {
|
||||
{loading ? loadingBlock : <div>{children}</div>}
|
||||
</div>
|
||||
);
|
||||
const mainContent = (
|
||||
<div>
|
||||
{head}
|
||||
{coverDom}
|
||||
{children ? body : null}
|
||||
</div>
|
||||
);
|
||||
const actionDom = actions && actions.length ?
|
||||
<ul className={`${prefixCls}-actions`}>{this.getAction(actions)}</ul> : null;
|
||||
const divProps = omit(others, [
|
||||
@ -197,7 +190,9 @@ export default class Card extends React.Component<CardProps, {}> {
|
||||
]);
|
||||
return (
|
||||
<div {...divProps} className={classString} ref={this.saveRef}>
|
||||
{mainContent}
|
||||
{head}
|
||||
{coverDom}
|
||||
{children ? body : null}
|
||||
{actionDom}
|
||||
</div>
|
||||
);
|
||||
|
Loading…
Reference in New Issue
Block a user