Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion components/card/Card.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -29,6 +29,7 @@ export default {
size: PropTypes.oneOf(['default', 'small']),
actions: PropTypes.any,
tabList: PropTypes.array,
tabProps: PropTypes.object,
tabBarExtraContent: PropTypes.any,
activeTabKey: PropTypes.string,
defaultActiveTabKey: PropTypes.string,
Expand Down Expand Up @@ -73,6 +74,7 @@ export default {
size = 'default',
type,
tabList,
tabProps = {},
hoverable,
activeTabKey,
defaultActiveTabKey,
Expand Down Expand Up @@ -145,7 +147,7 @@ export default {
const hasActiveTabKey = activeTabKey !== undefined;
const tabsProps = {
props: {
size: 'large',
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

这里不能remove啊,默认是large

...tabProps,
[hasActiveTabKey ? 'activeKey' : 'defaultActiveKey']: hasActiveTabKey
? activeTabKey
: defaultActiveTabKey,
Expand Down
43 changes: 32 additions & 11 deletions examples/App.vue
Original file line number Diff line number Diff line change
@@ -1,16 +1,37 @@
<template>
<div>
<a-collapse :accordion="true" default-active-key="2" :bordered="false">
<a-collapse-panel key="1" header="This is panel header 1">
<p>{{ text }}</p>
</a-collapse-panel>
<a-collapse-panel key="2" header="This is panel header 2" :disabled="false">
<p>{{ text }}</p>
</a-collapse-panel>
<a-collapse-panel key="3" header="This is panel header 3">
<p>{{ text }}</p>
</a-collapse-panel>
</a-collapse>
<a-card
title="测试"
:tab-props="{ size: 'small' }"
:tab-list="[
{ key: 'tab1', tab: 'tab1' },
{ key: 'tab2', tab: 'tab2' },
]"
/>
<a-card
title="测试"
:tab-props="{ size: 'large' }"
:tab-list="[
{ key: 'tab1', tab: 'tab1' },
{ key: 'tab2', tab: 'tab2' },
]"
/>
<a-card
title="测试"
:tab-props="{}"
:tab-list="[
{ key: 'tab1', tab: 'tab1' },
{ key: 'tab2', tab: 'tab2' },
]"
/>
<a-card
title="测试"
:tab-props="{ size: 'default' }"
:tab-list="[
{ key: 'tab1', tab: 'tab1' },
{ key: 'tab2', tab: 'tab2' },
]"
/>
</div>
</template>
<script>
Expand Down