x-collapse

1.0.8 • Public • Published

x-collapse

react折叠组件

NPM

npm install --save x-collapse

代码示例

<Collapse defaultActive={["1"]} bordered={true} expandIconPosition="right">
<Collapse.Panel key="1" title="abc">
    123123
</Collapse.Panel>
<Collapse.Panel key="2" title="abc">
    123123
</Collapse.Panel>
<Collapse.Panel key="3" title="abc">
    123123
</Collapse.Panel>
</Collapse>
 
<h2>手风琴模式</h2>
<Collapse defaultActive={["1"]} accordion={true}>
<Collapse.Panel key="1" title="abc">
    123123
</Collapse.Panel>
<Collapse.Panel key="2" title="abc">
    123123
</Collapse.Panel>
<Collapse.Panel key="3" title="abc">
    123123
</Collapse.Panel>
</Collapse>

API

defaultValue:[]||string

默认选中项,为数组或string 与表单元素一致,有value和defaultValue,对应Panel的key值

bordered:true

是否有边框,默认为true

accordion:false

手风琴模式

expandIconPosition:"left"||"right"

展开图标显示的位置,默认为left

Panel

key:String

唯一标识

title:String||ReactNode

头部标题

children:any

展开的内容

关于作者

https://github.com/tianxiangbing

Package Sidebar

Install

npm i x-collapse

Weekly Downloads

0

Version

1.0.8

License

MIT

Unpacked Size

108 kB

Total Files

34

Last publish

Collaborators

  • tianxiangbing