ExpandableCard

ExpandableCard 可展开/折叠的卡片

代码示例

import { BfExpandableCard } from '@bud-fe/react-taro-ui';
import { View } from '@tarojs/components';
import React from 'react';
export default () => {
return (
<>
<View>基本用法 </View>
<BfExpandableCard
collapsedHeight={40}
onClick={() => {
console.log('outer onClick');
}}
onExpand={(expanded) => {
console.log('onExpand', expanded);
}}
>
<View>AAAAAAAAAAAA</View>
<View>AAAAAAAAAAAA</View>
<View>BBBBBBBBBBBB</View>
<View>BBBBBBBBBBBB</View>
<View>CCCCCCCCCCCC</View>
<View>CCCCCCCCCCCC</View>
</BfExpandableCard>
<View>不显示收起按钮 </View>
<BfExpandableCard collapsible={false}>
<View>AAAAAAAAAAAA</View>
<View>AAAAAAAAAAAA</View>
<View>BBBBBBBBBBBB</View>
<View>BBBBBBBBBBBB</View>
<View>CCCCCCCCCCCC</View>
<View>CCCCCCCCCCCC</View>
</BfExpandableCard>
</>
);
};

API

属性名描述类型默认值
collapsible是否可收起,若为否则默认展开且不显示收起按钮boolean--
defaultExpanded默认是否展开booleanfalse
collapsedHeight收起时的高度string | number0
expandedText展开文案string'展开'
collapsedText收起文案string'收起'
onExpand展开/收起时触发(expanded: boolean) => void--
dumi10:24