$ npm i react-component-panel --saveimport{Panel,CollapsiblePanel}from'react-component-panel'- Panel
- CollapsiblePanel
Extends PureComponent
CollapsiblePanel
Parameters
props
Examples
classCollapsiblePanelDemoextendsComponent{render(){return(<CollapsiblePaneltitle="Collapsible Panel Demo"><p>I am collapsible panel !</p></CollapsiblePanel>);}}Properties
contentStyleObject?contentClassNameString?expandBoolean? [ true ] - 是否展开renderExpandFunction? [ expand=> {return expand ? "收起" : "展开";} ] - 展开/收起的UI样式onChangeFunction? 当expand发生变化时调用
Extends PureComponent
Panel
Examples
Simple Panel Demo
classPanelDemoextendsComponent{render(){return(<Paneltitle="Panel Title"renderRight={()=>{return(<buttontype="button"onClick={()=>{alert('pressed');}}>press me</button>);}}><p>panel content</p></Panel>);}}Properties
title(String | ReactNode | HtmlElement) 标题renderRightFunction? [ ()=>null ] - 右侧按钮styleObject? 样式classNameString? class style

