-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path47-bc4eac5649ec72ccd951.js
1 lines (1 loc) · 46.3 KB
/
47-bc4eac5649ec72ccd951.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[47],{651:function(n,a,s){"use strict";s.r(a),s.d(a,"default",function(){return _});var t=s(580),p=s.n(t),e=s(23),o=s.n(e),c=s(24),l=s.n(c),u=s(25),k=s.n(u),i=s(26),r=s.n(i),d=s(32),g=s.n(d),h=s(27),m=s.n(h),y=s(28),v=s.n(y),f=s(0),C=s.n(f),w=s(111),b=s(82),E=function(){var n=function(n){function a(){var n,s;o()(this,a);for(var t=arguments.length,p=new Array(t),e=0;e<t;e++)p[e]=arguments[e];return s=k()(this,(n=r()(a)).call.apply(n,[this].concat(p))),v()(g()(s),"state",{activeKey:"1",bg:!0}),v()(g()(s),"handleChange",function(n){s.setState({activeKey:n})}),v()(g()(s),"handleBgChange",function(n){s.setState({bg:n})}),s}return m()(a,n),l()(a,[{key:"render",value:function(){var n=this.state,a=n.activeKey,s=n.bg?"default":"none";return C.a.createElement(C.a.Fragment,null,C.a.createElement("div",{style:{marginBottom:20}},C.a.createElement(b.xb,{size:"small",checked:this.state.bg,onChange:this.handleBgChange}),C.a.createElement("span",null," 底色")),C.a.createElement(b.o,{panelTitleBackground:s,activeKey:a,onChange:this.handleChange},C.a.createElement(b.o.Panel,{title:"南歌子(暮春)",key:"1"},"紫陌寻春去,红尘拂面来。无人不道看花回。惟见石榴新蕊、一枝开。 冰簟堆云髻,金尊滟玉醅。绿阴青子相催。留取红巾千点、照池台。"),C.a.createElement(b.o.Panel,{title:"沁园春",key:"2"},"孤馆灯青,野店鸡号,旅枕梦残。渐月华收练,晨霜耿耿,云山摛锦,朝露漙漙。世路无穷,劳生有限,似此区区长鲜欢。微吟罢,凭征鞍无语,往事千端。 当时共客长安。似二陆初来俱少年。有笔头千字,胸中万卷,致君尧舜,此事何难。用舍由时,行藏在我,袖手何妨闲处看。身长健,但优游卒岁,且斗尊前。"),C.a.createElement(b.o.Panel,{title:"浣溪沙",key:"3",disabled:!0},"缥缈红妆照浅溪。薄云疏雨不成泥。送君何处古台西。 废沼夜来秋水满,茂林深处晚莺啼。行人肠断草凄迷。")))}}]),a}(C.a.Component);return C.a.createElement(n,null)},K=function(){var n=function(n){function a(){var n,s;o()(this,a);for(var t=arguments.length,p=new Array(t),e=0;e<t;e++)p[e]=arguments[e];return s=k()(this,(n=r()(a)).call.apply(n,[this].concat(p))),v()(g()(s),"state",{activeKey:"1"}),s}return m()(a,n),l()(a,[{key:"handleChange",value:function(n){this.setState({activeKey:n})}},{key:"render",value:function(){var n=this.state.activeKey;return C.a.createElement(b.o,{activeKey:n,onChange:this.handleChange.bind(this),accordion:!0},C.a.createElement(b.o.Panel,{title:"南歌子(暮春)",key:"1"},"紫陌寻春去,红尘拂面来。无人不道看花回。惟见石榴新蕊、一枝开。 冰簟堆云髻,金尊滟玉醅。绿阴青子相催。留取红巾千点、照池台。"),C.a.createElement(b.o.Panel,{title:"沁园春",key:"2"},"孤馆灯青,野店鸡号,旅枕梦残。渐月华收练,晨霜耿耿,云山摛锦,朝露漙漙。世路无穷,劳生有限,似此区区长鲜欢。微吟罢,凭征鞍无语,往事千端。 当时共客长安。似二陆初来俱少年。有笔头千字,胸中万卷,致君尧舜,此事何难。用舍由时,行藏在我,袖手何妨闲处看。身长健,但优游卒岁,且斗尊前。"),C.a.createElement(b.o.Panel,{title:"浣溪沙",key:"3"},"缥缈红妆照浅溪。薄云疏雨不成泥。送君何处古台西。 废沼夜来秋水满,茂林深处晚莺啼。行人肠断草凄迷。"))}}]),a}(C.a.Component);return C.a.createElement(n,null)},P=function(){var n=function(n){function a(){var n,s;o()(this,a);for(var t=arguments.length,p=new Array(t),e=0;e<t;e++)p[e]=arguments[e];return s=k()(this,(n=r()(a)).call.apply(n,[this].concat(p))),v()(g()(s),"state",{activeKey:"1",bg:!1}),v()(g()(s),"handleChange",function(n){s.setState({activeKey:n})}),v()(g()(s),"handleBgChange",function(n){s.setState({bg:n})}),s}return m()(a,n),l()(a,[{key:"render",value:function(){var n=this.state,a=n.activeKey,s=n.bg?"default":"none";return C.a.createElement(C.a.Fragment,null,C.a.createElement("div",{style:{marginBottom:20}},C.a.createElement(b.xb,{size:"small",checked:this.state.bg,onChange:this.handleBgChange}),C.a.createElement("span",null," 底色")),C.a.createElement(b.o,{panelTitleBackground:s,activeKey:a,onChange:this.handleChange,bordered:!1},C.a.createElement(b.o.Panel,{title:"南歌子(暮春)",key:"1"},"紫陌寻春去,红尘拂面来。无人不道看花回。惟见石榴新蕊、一枝开。 冰簟堆云髻,金尊滟玉醅。绿阴青子相催。留取红巾千点、照池台。"),C.a.createElement(b.o.Panel,{title:"沁园春",key:"2"},"孤馆灯青,野店鸡号,旅枕梦残。渐月华收练,晨霜耿耿,云山摛锦,朝露漙漙。世路无穷,劳生有限,似此区区长鲜欢。微吟罢,凭征鞍无语,往事千端。 当时共客长安。似二陆初来俱少年。有笔头千字,胸中万卷,致君尧舜,此事何难。用舍由时,行藏在我,袖手何妨闲处看。身长健,但优游卒岁,且斗尊前。"),C.a.createElement(b.o.Panel,{title:"浣溪沙",key:"3"},"缥缈红妆照浅溪。薄云疏雨不成泥。送君何处古台西。 废沼夜来秋水满,茂林深处晚莺啼。行人肠断草凄迷。")))}}]),a}(C.a.Component);return C.a.createElement(n,null)},j=function(){var n=function(n){function a(){var n,s;o()(this,a);for(var t=arguments.length,p=new Array(t),e=0;e<t;e++)p[e]=arguments[e];return s=k()(this,(n=r()(a)).call.apply(n,[this].concat(p))),v()(g()(s),"state",{activeKey:"1"}),s}return m()(a,n),l()(a,[{key:"handleChange",value:function(n){this.setState({activeKey:n})}},{key:"render",value:function(){var n=this.state.activeKey;return C.a.createElement(b.o,{activeKey:n,onChange:this.handleChange.bind(this)},C.a.createElement(b.o.Panel,{title:"南歌子(暮春)",key:"1",showArrow:!1},"紫陌寻春去,红尘拂面来。无人不道看花回。惟见石榴新蕊、一枝开。 冰簟堆云髻,金尊滟玉醅。绿阴青子相催。留取红巾千点、照池台。"),C.a.createElement(b.o.Panel,{title:"沁园春",key:"2",showArrow:!1},"孤馆灯青,野店鸡号,旅枕梦残。渐月华收练,晨霜耿耿,云山摛锦,朝露漙漙。世路无穷,劳生有限,似此区区长鲜欢。微吟罢,凭征鞍无语,往事千端。 当时共客长安。似二陆初来俱少年。有笔头千字,胸中万卷,致君尧舜,此事何难。用舍由时,行藏在我,袖手何妨闲处看。身长健,但优游卒岁,且斗尊前。"),C.a.createElement(b.o.Panel,{title:"浣溪沙",key:"3",showArrow:!1},"缥缈红妆照浅溪。薄云疏雨不成泥。送君何处古台西。 废沼夜来秋水满,茂林深处晚莺啼。行人肠断草凄迷。"))}}]),a}(C.a.Component);return C.a.createElement(n,null)};function S(n){return C.a.createElement(n.tag,p()({},n.attributes,{dangerouslySetInnerHTML:{__html:n.html}}))}function z(n){return C.a.createElement(S,{tag:"section",html:n.html,attributes:{className:"zandoc-react-markdown"}})}function B(n){return C.a.createElement(S,{tag:"style",html:n.style})}var N=function(n){function a(){var n,s;o()(this,a);for(var t=arguments.length,p=new Array(t),e=0;e<t;e++)p[e]=arguments[e];return s=k()(this,(n=r()(a)).call.apply(n,[this].concat(p))),v()(g()(s),"state",{showCode:!1}),v()(g()(s),"toggle",function(){s.setState({showCode:!s.state.showCode})}),s}return m()(a,n),l()(a,[{key:"render",value:function(){var n=this.state.showCode,a=this.props,s=a.title,t=a.src,p=a.children;return C.a.createElement("div",{className:"zandoc-react-demo"},C.a.createElement("div",{className:"zandoc-react-demo__preview"},p),C.a.createElement("div",{className:"zandoc-react-demo__bottom",onClick:this.toggle},C.a.createElement("div",{className:"zandoc-react-demo__title"},C.a.createElement("p",null,s||"")),C.a.createElement("i",{className:"zenticon zenticon-caret-up zandoc-react-demo__toggle ".concat(n?"zandoc-react-demo__toggle-on":"zandoc-react-demo__toggle-off")})),n&&C.a.createElement("pre",{className:"zandoc-react-demo__code"},C.a.createElement(S,{tag:"code",html:t,attributes:{className:"language-jsx"}})))}}]),a}(f.Component),_=function(n){function a(){return o()(this,a),k()(this,r()(a).apply(this,arguments))}return m()(a,n),l()(a,[{key:"componentDidMount",value:function(){var n=location.hash;if(n){var a=document.querySelector('a[href="'.concat(n,'"]'));a&&Object(w.a)(document.documentElement,0,function n(a,s){for(;a;)return a.offsetTop&&"static"!==getComputedStyle(a).position&&(s+=a.offsetTop),n(a.parentNode,s);return s}(a,-9))}}},{key:"render",value:function(){return C.a.createElement("div",{className:"zandoc-react-container",key:null},C.a.createElement(B,{style:""}),C.a.createElement(z,{html:'<h2 class="anchor-heading"><a href="#collapse-zhe-die-mian-ban">¶</a><a href="javascript:void(0)" id="collapse-zhe-die-mian-ban" class="anchor-point"></a>Collapse 折叠面板</h2>\n<p>折叠/展开内容区域。</p>\n<h3 class="anchor-heading"><a href="#shi-yong-zhi-nan">¶</a><a href="javascript:void(0)" id="shi-yong-zhi-nan" class="anchor-point"></a>使用指南</h3>\n<ul>\n<li>对复杂区域进行分组和隐藏</li>\n<li>手风琴是一种特殊的折叠面板,同一时刻只允许打开一个折叠区域</li>\n</ul>\n<h3 class="anchor-heading"><a href="#dai-ma-yan-shi">¶</a><a href="javascript:void(0)" id="dai-ma-yan-shi" class="anchor-point"></a>代码演示</h3>'}),C.a.createElement(N,{title:"基础用法",id:"Demobasic",src:'<span class="token keyword">import</span> <span class="token punctuation">{</span> Collapse<span class="token punctuation">,</span> Switch <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">\'zent\'</span><span class="token punctuation">;</span>\n\n<span class="token keyword">class</span> <span class="token class-name">Simple</span> <span class="token keyword">extends</span> <span class="token class-name">React<span class="token punctuation">.</span>Component</span> <span class="token punctuation">{</span>\n state <span class="token operator">=</span> <span class="token punctuation">{</span>\n activeKey<span class="token punctuation">:</span> <span class="token string">\'1\'</span><span class="token punctuation">,</span>\n bg<span class="token punctuation">:</span> <span class="token boolean">true</span><span class="token punctuation">,</span>\n <span class="token punctuation">}</span><span class="token punctuation">;</span>\n\n <span class="token function-variable function">handleChange</span> <span class="token operator">=</span> activeKey <span class="token operator">=></span> <span class="token punctuation">{</span>\n <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">setState</span><span class="token punctuation">(</span><span class="token punctuation">{</span>\n activeKey<span class="token punctuation">,</span>\n <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span><span class="token punctuation">;</span>\n\n <span class="token function-variable function">handleBgChange</span> <span class="token operator">=</span> bg <span class="token operator">=></span> <span class="token punctuation">{</span>\n <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">setState</span><span class="token punctuation">(</span><span class="token punctuation">{</span> bg <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span><span class="token punctuation">;</span>\n\n <span class="token function">render</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n <span class="token keyword">const</span> <span class="token punctuation">{</span> activeKey<span class="token punctuation">,</span> bg <span class="token punctuation">}</span> <span class="token operator">=</span> <span class="token keyword">this</span><span class="token punctuation">.</span>state<span class="token punctuation">;</span>\n <span class="token keyword">const</span> titleBg <span class="token operator">=</span> bg <span class="token operator">?</span> <span class="token string">\'default\'</span> <span class="token punctuation">:</span> <span class="token string">\'none\'</span><span class="token punctuation">;</span>\n\n <span class="token keyword">return</span> <span class="token punctuation">(</span>\n <span class="token operator"><</span><span class="token operator">></span>\n <span class="token operator"><</span>div style<span class="token operator">=</span><span class="token punctuation">{</span><span class="token punctuation">{</span> marginBottom<span class="token punctuation">:</span> <span class="token number">20</span> <span class="token punctuation">}</span><span class="token punctuation">}</span><span class="token operator">></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>Switch</span>\n <span class="token attr-name">size</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>small<span class="token punctuation">"</span></span>\n <span class="token attr-name">checked</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span>state<span class="token punctuation">.</span>bg<span class="token punctuation">}</span></span>\n <span class="token attr-name">onChange</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span>handleBgChange<span class="token punctuation">}</span></span>\n <span class="token punctuation">/></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>span</span><span class="token punctuation">></span></span> 底色<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>span</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>div</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>Collapse</span>\n <span class="token attr-name">panelTitleBackground</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span>titleBg<span class="token punctuation">}</span></span>\n <span class="token attr-name">activeKey</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span>activeKey<span class="token punctuation">}</span></span>\n <span class="token attr-name">onChange</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span>handleChange<span class="token punctuation">}</span></span>\n <span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>Collapse.Panel</span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>南歌子(暮春)<span class="token punctuation">"</span></span> <span class="token attr-name">key</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>1<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n 紫陌寻春去,红尘拂面来。无人不道看花回。惟见石榴新蕊、一枝开。 冰簟堆云髻,金尊滟玉醅。绿阴青子相催。留取红巾千点、照池台。\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>Collapse.Panel</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>Collapse.Panel</span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>沁园春<span class="token punctuation">"</span></span> <span class="token attr-name">key</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>2<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n 孤馆灯青,野店鸡号,旅枕梦残。渐月华收练,晨霜耿耿,云山摛锦,朝露漙漙。世路无穷,劳生有限,似此区区长鲜欢。微吟罢,凭征鞍无语,往事千端。 当时共客长安。似二陆初来俱少年。有笔头千字,胸中万卷,致君尧舜,此事何难。用舍由时,行藏在我,袖手何妨闲处看。身长健,但优游卒岁,且斗尊前。\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>Collapse.Panel</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>Collapse.Panel</span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>浣溪沙<span class="token punctuation">"</span></span> <span class="token attr-name">key</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>3<span class="token punctuation">"</span></span> <span class="token attr-name">disabled</span><span class="token punctuation">></span></span>\n 缥缈红妆照浅溪。薄云疏雨不成泥。送君何处古台西。\n废沼夜来秋水满,茂林深处晚莺啼。行人肠断草凄迷。\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>Collapse.Panel</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>Collapse</span><span class="token punctuation">></span></span>\n <span class="token operator"><</span><span class="token operator">/</span><span class="token operator">></span>\n <span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span>\n<span class="token punctuation">}</span>\n\nReactDOM<span class="token punctuation">.</span><span class="token function">render</span><span class="token punctuation">(</span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>Simple</span> <span class="token punctuation">/></span></span><span class="token punctuation">,</span> mountNode<span class="token punctuation">)</span><span class="token punctuation">;</span>'},C.a.createElement(E)),C.a.createElement(N,{title:"手风琴风格,每次只能打开一个面板。",id:"Demoaccordion",src:'<span class="token keyword">import</span> <span class="token punctuation">{</span> Collapse <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">\'zent\'</span><span class="token punctuation">;</span>\n\n<span class="token keyword">class</span> <span class="token class-name">Simple</span> <span class="token keyword">extends</span> <span class="token class-name">React<span class="token punctuation">.</span>Component</span> <span class="token punctuation">{</span>\n state <span class="token operator">=</span> <span class="token punctuation">{</span>\n activeKey<span class="token punctuation">:</span> <span class="token string">\'1\'</span><span class="token punctuation">,</span>\n <span class="token punctuation">}</span><span class="token punctuation">;</span>\n\n <span class="token function">handleChange</span><span class="token punctuation">(</span>activeKey<span class="token punctuation">)</span> <span class="token punctuation">{</span>\n <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">setState</span><span class="token punctuation">(</span><span class="token punctuation">{</span>\n activeKey<span class="token punctuation">,</span>\n <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span>\n\n <span class="token function">render</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n <span class="token keyword">const</span> <span class="token punctuation">{</span> activeKey <span class="token punctuation">}</span> <span class="token operator">=</span> <span class="token keyword">this</span><span class="token punctuation">.</span>state<span class="token punctuation">;</span>\n <span class="token keyword">return</span> <span class="token punctuation">(</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>Collapse</span>\n <span class="token attr-name">activeKey</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span>activeKey<span class="token punctuation">}</span></span>\n <span class="token attr-name">onChange</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span>handleChange<span class="token punctuation">.</span><span class="token function">bind</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">)</span><span class="token punctuation">}</span></span>\n <span class="token attr-name">accordion</span>\n <span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>Collapse.Panel</span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>南歌子(暮春)<span class="token punctuation">"</span></span> <span class="token attr-name">key</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>1<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n 紫陌寻春去,红尘拂面来。无人不道看花回。惟见石榴新蕊、一枝开。 冰簟堆云髻,金尊滟玉醅。绿阴青子相催。留取红巾千点、照池台。\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>Collapse.Panel</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>Collapse.Panel</span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>沁园春<span class="token punctuation">"</span></span> <span class="token attr-name">key</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>2<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n 孤馆灯青,野店鸡号,旅枕梦残。渐月华收练,晨霜耿耿,云山摛锦,朝露漙漙。世路无穷,劳生有限,似此区区长鲜欢。微吟罢,凭征鞍无语,往事千端。 当时共客长安。似二陆初来俱少年。有笔头千字,胸中万卷,致君尧舜,此事何难。用舍由时,行藏在我,袖手何妨闲处看。身长健,但优游卒岁,且斗尊前。\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>Collapse.Panel</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>Collapse.Panel</span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>浣溪沙<span class="token punctuation">"</span></span> <span class="token attr-name">key</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>3<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n 缥缈红妆照浅溪。薄云疏雨不成泥。送君何处古台西。\n废沼夜来秋水满,茂林深处晚莺啼。行人肠断草凄迷。\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>Collapse.Panel</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>Collapse</span><span class="token punctuation">></span></span>\n <span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span>\n<span class="token punctuation">}</span>\n\nReactDOM<span class="token punctuation">.</span><span class="token function">render</span><span class="token punctuation">(</span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>Simple</span> <span class="token punctuation">/></span></span><span class="token punctuation">,</span> mountNode<span class="token punctuation">)</span><span class="token punctuation">;</span>'},C.a.createElement(K)),C.a.createElement(N,{title:"无边框样式",id:"Demonoborder",src:'<span class="token keyword">import</span> <span class="token punctuation">{</span> Collapse <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">\'zent\'</span><span class="token punctuation">;</span>\n\n<span class="token keyword">class</span> <span class="token class-name">Simple</span> <span class="token keyword">extends</span> <span class="token class-name">React<span class="token punctuation">.</span>Component</span> <span class="token punctuation">{</span>\n state <span class="token operator">=</span> <span class="token punctuation">{</span>\n activeKey<span class="token punctuation">:</span> <span class="token string">\'1\'</span><span class="token punctuation">,</span>\n bg<span class="token punctuation">:</span> <span class="token boolean">false</span><span class="token punctuation">,</span>\n <span class="token punctuation">}</span><span class="token punctuation">;</span>\n\n <span class="token function-variable function">handleChange</span> <span class="token operator">=</span> activeKey <span class="token operator">=></span> <span class="token punctuation">{</span>\n <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">setState</span><span class="token punctuation">(</span><span class="token punctuation">{</span>\n activeKey<span class="token punctuation">,</span>\n <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span><span class="token punctuation">;</span>\n\n <span class="token function-variable function">handleBgChange</span> <span class="token operator">=</span> bg <span class="token operator">=></span> <span class="token punctuation">{</span>\n <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">setState</span><span class="token punctuation">(</span><span class="token punctuation">{</span> bg <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span><span class="token punctuation">;</span>\n\n <span class="token function">render</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n <span class="token keyword">const</span> <span class="token punctuation">{</span> activeKey<span class="token punctuation">,</span> bg <span class="token punctuation">}</span> <span class="token operator">=</span> <span class="token keyword">this</span><span class="token punctuation">.</span>state<span class="token punctuation">;</span>\n <span class="token keyword">const</span> titleBg <span class="token operator">=</span> bg <span class="token operator">?</span> <span class="token string">\'default\'</span> <span class="token punctuation">:</span> <span class="token string">\'none\'</span><span class="token punctuation">;</span>\n\n <span class="token keyword">return</span> <span class="token punctuation">(</span>\n <span class="token operator"><</span><span class="token operator">></span>\n <span class="token operator"><</span>div style<span class="token operator">=</span><span class="token punctuation">{</span><span class="token punctuation">{</span> marginBottom<span class="token punctuation">:</span> <span class="token number">20</span> <span class="token punctuation">}</span><span class="token punctuation">}</span><span class="token operator">></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>Switch</span>\n <span class="token attr-name">size</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>small<span class="token punctuation">"</span></span>\n <span class="token attr-name">checked</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span>state<span class="token punctuation">.</span>bg<span class="token punctuation">}</span></span>\n <span class="token attr-name">onChange</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span>handleBgChange<span class="token punctuation">}</span></span>\n <span class="token punctuation">/></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>span</span><span class="token punctuation">></span></span> 底色<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>span</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>div</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>Collapse</span>\n <span class="token attr-name">panelTitleBackground</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span>titleBg<span class="token punctuation">}</span></span>\n <span class="token attr-name">activeKey</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span>activeKey<span class="token punctuation">}</span></span>\n <span class="token attr-name">onChange</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span>handleChange<span class="token punctuation">}</span></span>\n <span class="token attr-name">bordered</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span><span class="token boolean">false</span><span class="token punctuation">}</span></span>\n <span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>Collapse.Panel</span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>南歌子(暮春)<span class="token punctuation">"</span></span> <span class="token attr-name">key</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>1<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n 紫陌寻春去,红尘拂面来。无人不道看花回。惟见石榴新蕊、一枝开。 冰簟堆云髻,金尊滟玉醅。绿阴青子相催。留取红巾千点、照池台。\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>Collapse.Panel</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>Collapse.Panel</span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>沁园春<span class="token punctuation">"</span></span> <span class="token attr-name">key</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>2<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n 孤馆灯青,野店鸡号,旅枕梦残。渐月华收练,晨霜耿耿,云山摛锦,朝露漙漙。世路无穷,劳生有限,似此区区长鲜欢。微吟罢,凭征鞍无语,往事千端。 当时共客长安。似二陆初来俱少年。有笔头千字,胸中万卷,致君尧舜,此事何难。用舍由时,行藏在我,袖手何妨闲处看。身长健,但优游卒岁,且斗尊前。\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>Collapse.Panel</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>Collapse.Panel</span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>浣溪沙<span class="token punctuation">"</span></span> <span class="token attr-name">key</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>3<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>\n 缥缈红妆照浅溪。薄云疏雨不成泥。送君何处古台西。\n废沼夜来秋水满,茂林深处晚莺啼。行人肠断草凄迷。\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>Collapse.Panel</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>Collapse</span><span class="token punctuation">></span></span>\n <span class="token operator"><</span><span class="token operator">/</span><span class="token operator">></span>\n <span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span>\n<span class="token punctuation">}</span>\n\nReactDOM<span class="token punctuation">.</span><span class="token function">render</span><span class="token punctuation">(</span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>Simple</span> <span class="token punctuation">/></span></span><span class="token punctuation">,</span> mountNode<span class="token punctuation">)</span><span class="token punctuation">;</span>'},C.a.createElement(P)),C.a.createElement(N,{title:"无箭头样式",id:"Demonoarrow",src:'<span class="token keyword">import</span> <span class="token punctuation">{</span> Collapse <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">\'zent\'</span><span class="token punctuation">;</span>\n\n<span class="token keyword">class</span> <span class="token class-name">Simple</span> <span class="token keyword">extends</span> <span class="token class-name">React<span class="token punctuation">.</span>Component</span> <span class="token punctuation">{</span>\n state <span class="token operator">=</span> <span class="token punctuation">{</span>\n activeKey<span class="token punctuation">:</span> <span class="token string">\'1\'</span>\n <span class="token punctuation">}</span><span class="token punctuation">;</span>\n\n <span class="token function">handleChange</span><span class="token punctuation">(</span>activeKey<span class="token punctuation">)</span> <span class="token punctuation">{</span>\n <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token function">setState</span><span class="token punctuation">(</span><span class="token punctuation">{</span>\n activeKey\n <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span>\n\n <span class="token function">render</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n <span class="token keyword">const</span> <span class="token punctuation">{</span> activeKey <span class="token punctuation">}</span> <span class="token operator">=</span> <span class="token keyword">this</span><span class="token punctuation">.</span>state<span class="token punctuation">;</span>\n <span class="token keyword">return</span> <span class="token punctuation">(</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>Collapse</span> <span class="token attr-name">activeKey</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span>activeKey<span class="token punctuation">}</span></span> <span class="token attr-name">onChange</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span>handleChange<span class="token punctuation">.</span><span class="token function">bind</span><span class="token punctuation">(</span><span class="token keyword">this</span><span class="token punctuation">)</span><span class="token punctuation">}</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>Collapse.Panel</span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>南歌子(暮春)<span class="token punctuation">"</span></span> <span class="token attr-name">key</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>1<span class="token punctuation">"</span></span> <span class="token attr-name">showArrow</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span><span class="token boolean">false</span><span class="token punctuation">}</span></span><span class="token punctuation">></span></span>\n 紫陌寻春去,红尘拂面来。无人不道看花回。惟见石榴新蕊、一枝开。 冰簟堆云髻,金尊滟玉醅。绿阴青子相催。留取红巾千点、照池台。\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>Collapse.Panel</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>Collapse.Panel</span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>沁园春<span class="token punctuation">"</span></span> <span class="token attr-name">key</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>2<span class="token punctuation">"</span></span> <span class="token attr-name">showArrow</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span><span class="token boolean">false</span><span class="token punctuation">}</span></span><span class="token punctuation">></span></span>\n 孤馆灯青,野店鸡号,旅枕梦残。渐月华收练,晨霜耿耿,云山摛锦,朝露漙漙。世路无穷,劳生有限,似此区区长鲜欢。微吟罢,凭征鞍无语,往事千端。 当时共客长安。似二陆初来俱少年。有笔头千字,胸中万卷,致君尧舜,此事何难。用舍由时,行藏在我,袖手何妨闲处看。身长健,但优游卒岁,且斗尊前。\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>Collapse.Panel</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>Collapse.Panel</span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>浣溪沙<span class="token punctuation">"</span></span> <span class="token attr-name">key</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>3<span class="token punctuation">"</span></span> <span class="token attr-name">showArrow</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span><span class="token boolean">false</span><span class="token punctuation">}</span></span><span class="token punctuation">></span></span>\n 缥缈红妆照浅溪。薄云疏雨不成泥。送君何处古台西。\n废沼夜来秋水满,茂林深处晚莺啼。行人肠断草凄迷。\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>Collapse.Panel</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>Collapse</span><span class="token punctuation">></span></span>\n <span class="token punctuation">)</span>\n <span class="token punctuation">}</span>\n<span class="token punctuation">}</span>\n\nReactDOM<span class="token punctuation">.</span><span class="token function">render</span><span class="token punctuation">(</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>Simple</span> <span class="token punctuation">/></span></span>\n <span class="token punctuation">,</span> mountNode\n<span class="token punctuation">)</span><span class="token punctuation">;</span>'},C.a.createElement(j)),C.a.createElement(z,{html:'<h3 class="anchor-heading"><a href="#api">¶</a><a href="javascript:void(0)" id="api" class="anchor-point"></a>API</h3>\n<h4 class="anchor-heading"><a href="#collpase">¶</a><a href="javascript:void(0)" id="collpase" class="anchor-point"></a>Collpase</h4>\n<table class="table">\n<thead>\n<tr>\n<th>参数</th>\n<th>说明</th>\n<th>类型</th>\n<th>是否必须</th>\n<th>默认值</th>\n<th>备选值</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>onChange</td>\n<td>切换面板的回调函数</td>\n<td><code>func</code></td>\n<td>是</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>activeKey</td>\n<td>当前打开的面板 id</td>\n<td><code>string</code></td>\n<td>否</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>accordion</td>\n<td>手风琴模式,一次只能有一个 active 的面板</td>\n<td><code>bool</code></td>\n<td>否</td>\n<td><code>false</code></td>\n<td><code>true</code></td>\n</tr>\n<tr>\n<td>bordered</td>\n<td>是否有外边框</td>\n<td><code>bool</code></td>\n<td>否</td>\n<td><code>true</code></td>\n<td><code>false</code></td>\n</tr>\n<tr>\n<td>panelTitleBackground</td>\n<td>Panel 标题底色</td>\n<td><code>string</code></td>\n<td>否</td>\n<td><code>\'default\'</code></td>\n<td><code>\'none\'</code></td>\n</tr>\n<tr>\n<td>className</td>\n<td>额外类名</td>\n<td><code>string</code></td>\n<td>否</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>prefix</td>\n<td>自定义类名前缀</td>\n<td><code>string</code></td>\n<td>否</td>\n<td></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<h4 class="anchor-heading"><a href="#collpase-panel">¶</a><a href="javascript:void(0)" id="collpase-panel" class="anchor-point"></a>Collpase.Panel</h4>\n<table class="table">\n<thead>\n<tr>\n<th>参数</th>\n<th>说明</th>\n<th>类型</th>\n<th>是否必须</th>\n<th>默认值</th>\n<th>备选值</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>key</td>\n<td>面板 id</td>\n<td><code>string</code></td>\n<td>是</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>title</td>\n<td>面板标题</td>\n<td><code>node</code></td>\n<td>是</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>disabled</td>\n<td>禁用面板</td>\n<td><code>bool</code></td>\n<td>否</td>\n<td><code>false</code></td>\n<td><code>true</code></td>\n</tr>\n<tr>\n<td>showArrow</td>\n<td>是否显示箭头图标</td>\n<td><code>bool</code></td>\n<td>否</td>\n<td><code>true</code></td>\n<td><code>false</code></td>\n</tr>\n<tr>\n<td>style</td>\n<td>额外样式</td>\n<td><code>object</code></td>\n<td>否</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>className</td>\n<td>额外类名</td>\n<td><code>string</code></td>\n<td>否</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>prefix</td>\n<td>自定义类名前缀</td>\n<td><code>string</code></td>\n<td>否</td>\n<td></td>\n<td></td>\n</tr>\n</tbody>\n</table>'}))}}]),a}(f.Component)}}]);