feat: add prop tab-size for card (#3762)
* feat: add param tab-size for card * feat: add param tab-size for cardpull/3784/head
parent
48181af9d6
commit
dced59c65c
|
@ -29,6 +29,7 @@ export default {
|
||||||
size: PropTypes.oneOf(['default', 'small']),
|
size: PropTypes.oneOf(['default', 'small']),
|
||||||
actions: PropTypes.any,
|
actions: PropTypes.any,
|
||||||
tabList: PropTypes.array,
|
tabList: PropTypes.array,
|
||||||
|
tabProps: PropTypes.object,
|
||||||
tabBarExtraContent: PropTypes.any,
|
tabBarExtraContent: PropTypes.any,
|
||||||
activeTabKey: PropTypes.string,
|
activeTabKey: PropTypes.string,
|
||||||
defaultActiveTabKey: PropTypes.string,
|
defaultActiveTabKey: PropTypes.string,
|
||||||
|
@ -73,6 +74,7 @@ export default {
|
||||||
size = 'default',
|
size = 'default',
|
||||||
type,
|
type,
|
||||||
tabList,
|
tabList,
|
||||||
|
tabProps = {},
|
||||||
hoverable,
|
hoverable,
|
||||||
activeTabKey,
|
activeTabKey,
|
||||||
defaultActiveTabKey,
|
defaultActiveTabKey,
|
||||||
|
@ -145,7 +147,7 @@ export default {
|
||||||
const hasActiveTabKey = activeTabKey !== undefined;
|
const hasActiveTabKey = activeTabKey !== undefined;
|
||||||
const tabsProps = {
|
const tabsProps = {
|
||||||
props: {
|
props: {
|
||||||
size: 'large',
|
...tabProps,
|
||||||
[hasActiveTabKey ? 'activeKey' : 'defaultActiveKey']: hasActiveTabKey
|
[hasActiveTabKey ? 'activeKey' : 'defaultActiveKey']: hasActiveTabKey
|
||||||
? activeTabKey
|
? activeTabKey
|
||||||
: defaultActiveTabKey,
|
: defaultActiveTabKey,
|
||||||
|
|
|
@ -1,16 +1,37 @@
|
||||||
<template>
|
<template>
|
||||||
<div>
|
<div>
|
||||||
<a-collapse :accordion="true" default-active-key="2" :bordered="false">
|
<a-card
|
||||||
<a-collapse-panel key="1" header="This is panel header 1">
|
title="测试"
|
||||||
<p>{{ text }}</p>
|
:tab-props="{ size: 'small' }"
|
||||||
</a-collapse-panel>
|
:tab-list="[
|
||||||
<a-collapse-panel key="2" header="This is panel header 2" :disabled="false">
|
{ key: 'tab1', tab: 'tab1' },
|
||||||
<p>{{ text }}</p>
|
{ key: 'tab2', tab: 'tab2' },
|
||||||
</a-collapse-panel>
|
]"
|
||||||
<a-collapse-panel key="3" header="This is panel header 3">
|
/>
|
||||||
<p>{{ text }}</p>
|
<a-card
|
||||||
</a-collapse-panel>
|
title="测试"
|
||||||
</a-collapse>
|
: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>
|
</div>
|
||||||
</template>
|
</template>
|
||||||
<script>
|
<script>
|
||||||
|
|
Loading…
Reference in New Issue