ExpandableCard
ExpandableCard 可展开/折叠的卡片
代码示例
import { BfExpandableCard } from '@bud-fe/react-taro-ui';import { View } from '@tarojs/components';import React from 'react';export default () => {return (<><View>基本用法 </View><BfExpandableCardcollapsedHeight={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 | 默认是否展开 | boolean | false |
collapsedHeight | 收起时的高度 | string | number | 0 |
expandedText | 展开文案 | string | '展开' |
collapsedText | 收起文案 | string | '收起' |
onExpand | 展开/收起时触发 | (expanded: boolean) => void | -- |