x-collapse
react折叠组件
NPM
npm install --save x-collapse
代码示例
<Collapse = = ="right"><Collapse.Panel ="1" ="abc"> 123123</Collapse.Panel><Collapse.Panel ="2" ="abc"> 123123</Collapse.Panel><Collapse.Panel ="3" ="abc"> 123123</Collapse.Panel></Collapse> <h2>手风琴模式</h2><Collapse = =><Collapse.Panel ="1" ="abc"> 123123</Collapse.Panel><Collapse.Panel ="2" ="abc"> 123123</Collapse.Panel><Collapse.Panel ="3" ="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
展开的内容