-
Notifications
You must be signed in to change notification settings - Fork 1
/
2449-c22d43d3edf77b6bf1ab.js
1 lines (1 loc) · 65.7 KB
/
2449-c22d43d3edf77b6bf1ab.js
1
(self.webpackChunkzent_docs=self.webpackChunkzent_docs||[]).push([[2449],{82449:(n,a,s)=>{"use strict";s.r(a),s.d(a,{default:()=>b});var t=s(73450),p=s(27378),e=s(57318),o=s(31269),c=s(56377),l=s(24246);function u(n,a){var s=Object.keys(n);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);a&&(t=t.filter((function(a){return Object.getOwnPropertyDescriptor(n,a).enumerable}))),s.push.apply(s,t)}return s}function i(n){for(var a=1;a<arguments.length;a++){var s=null!=arguments[a]?arguments[a]:{};a%2?u(Object(s),!0).forEach((function(a){(0,t.Z)(n,a,s[a])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(s)):u(Object(s)).forEach((function(a){Object.defineProperty(n,a,Object.getOwnPropertyDescriptor(s,a))}))}return n}var k=function(){class n extends p.Component{constructor(...n){super(...n),(0,t.Z)(this,"state",{activeKey:["1"]}),(0,t.Z)(this,"handleChange",(n=>{this.setState({activeKey:n})}))}render(){var n=this.state.activeKey;return(0,l.jsxs)(o.U,{panelTitleBackground:"no",activeKey:n,onChange:this.handleChange,bordered:!1,children:[(0,l.jsx)(o.U.Panel,{title:"南歌子(暮春)",extra:(0,l.jsx)("a",{children:"自定义内容"}),children:"紫陌寻春去,红尘拂面来。无人不道看花回。惟见石榴新蕊、一枝开。 冰簟堆云髻,金尊滟玉醅。绿阴青子相催。留取红巾千点、照池台。"},"1"),(0,l.jsx)(o.U.Panel,{title:"沁园春",children:"孤馆灯青,野店鸡号,旅枕梦残。渐月华收练,晨霜耿耿,云山摛锦,朝露漙漙。世路无穷,劳生有限,似此区区长鲜欢。微吟罢,凭征鞍无语,往事千端。 当时共客长安。似二陆初来俱少年。有笔头千字,胸中万卷,致君尧舜,此事何难。用舍由时,行藏在我,袖手何妨闲处看。身长健,但优游卒岁,且斗尊前。"},"2"),(0,l.jsx)(o.U.Panel,{title:"浣溪沙",disabled:!0,children:"缥缈红妆照浅溪。薄云疏雨不成泥。送君何处古台西。 废沼夜来秋水满,茂林深处晚莺啼。行人肠断草凄迷。"},"3")]})}}return(0,l.jsx)(n,{})},r=function(){class n extends p.Component{constructor(...n){super(...n),(0,t.Z)(this,"state",{activeKey:"1"})}handleChange(n){this.setState({activeKey:n})}render(){var n=this.state.activeKey;return(0,l.jsxs)(o.U,{bordered:!1,panelTitleBackground:"no",activeKey:n,onChange:this.handleChange.bind(this),accordion:!0,children:[(0,l.jsx)(o.U.Panel,{title:"南歌子(暮春)",children:"紫陌寻春去,红尘拂面来。无人不道看花回。惟见石榴新蕊、一枝开。 冰簟堆云髻,金尊滟玉醅。绿阴青子相催。留取红巾千点、照池台。"},"1"),(0,l.jsx)(o.U.Panel,{title:"沁园春",children:"孤馆灯青,野店鸡号,旅枕梦残。渐月华收练,晨霜耿耿,云山摛锦,朝露漙漙。世路无穷,劳生有限,似此区区长鲜欢。微吟罢,凭征鞍无语,往事千端。 当时共客长安。似二陆初来俱少年。有笔头千字,胸中万卷,致君尧舜,此事何难。用舍由时,行藏在我,袖手何妨闲处看。身长健,但优游卒岁,且斗尊前。"},"2"),(0,l.jsx)(o.U.Panel,{title:"浣溪沙",children:"缥缈红妆照浅溪。薄云疏雨不成泥。送君何处古台西。 废沼夜来秋水满,茂林深处晚莺啼。行人肠断草凄迷。"},"3")]})}}return(0,l.jsx)(n,{})},d=function(){class n extends p.Component{constructor(...n){super(...n),(0,t.Z)(this,"state",{activeKey:"1"}),(0,t.Z)(this,"handleChange",(n=>{this.setState({activeKey:n})}))}render(){var n=this.state.activeKey;return(0,l.jsxs)(o.U,{panelTitleBackground:"no",showContentBackground:!0,activeKey:n,onChange:this.handleChange,bordered:!1,children:[(0,l.jsx)(o.U.Panel,{title:"南歌子(暮春)",extra:(0,l.jsx)("a",{children:"自定义内容"}),children:"紫陌寻春去,红尘拂面来。无人不道看花回。惟见石榴新蕊、一枝开。 冰簟堆云髻,金尊滟玉醅。绿阴青子相催。留取红巾千点、照池台。"},"1"),(0,l.jsx)(o.U.Panel,{title:"沁园春",children:"孤馆灯青,野店鸡号,旅枕梦残。渐月华收练,晨霜耿耿,云山摛锦,朝露漙漙。世路无穷,劳生有限,似此区区长鲜欢。微吟罢,凭征鞍无语,往事千端。 当时共客长安。似二陆初来俱少年。有笔头千字,胸中万卷,致君尧舜,此事何难。用舍由时,行藏在我,袖手何妨闲处看。身长健,但优游卒岁,且斗尊前。"},"2"),(0,l.jsx)(o.U.Panel,{title:"浣溪沙",children:"缥缈红妆照浅溪。薄云疏雨不成泥。送君何处古台西。 废沼夜来秋水满,茂林深处晚莺啼。行人肠断草凄迷。"},"3")]})}}return(0,l.jsx)(n,{})},h=function(){class n extends p.Component{constructor(...n){super(...n),(0,t.Z)(this,"state",{activeKey:["1"],bg:!0}),(0,t.Z)(this,"handleChange",(n=>{this.setState({activeKey:n})})),(0,t.Z)(this,"handleBgChange",(n=>{this.setState({bg:n})}))}render(){var n=this.state,a=n.activeKey,s=n.bg?"default":"none";return(0,l.jsxs)(l.Fragment,{children:[(0,l.jsxs)("div",{style:{marginBottom:20},children:[(0,l.jsx)(c.r,{size:"small",checked:this.state.bg,onChange:this.handleBgChange}),(0,l.jsx)("span",{children:" Title 底色"})]}),(0,l.jsxs)(o.U,{panelTitleBackground:s,activeKey:a,onChange:this.handleChange,children:[(0,l.jsx)(o.U.Panel,{title:"南歌子(暮春)",extra:(0,l.jsx)("a",{children:"自定义内容"}),children:"紫陌寻春去,红尘拂面来。无人不道看花回。惟见石榴新蕊、一枝开。 冰簟堆云髻,金尊滟玉醅。绿阴青子相催。留取红巾千点、照池台。"},"1"),(0,l.jsx)(o.U.Panel,{title:"沁园春",children:"孤馆灯青,野店鸡号,旅枕梦残。渐月华收练,晨霜耿耿,云山摛锦,朝露漙漙。世路无穷,劳生有限,似此区区长鲜欢。微吟罢,凭征鞍无语,往事千端。 当时共客长安。似二陆初来俱少年。有笔头千字,胸中万卷,致君尧舜,此事何难。用舍由时,行藏在我,袖手何妨闲处看。身长健,但优游卒岁,且斗尊前。"},"2"),(0,l.jsx)(o.U.Panel,{title:"浣溪沙",disabled:!0,children:"缥缈红妆照浅溪。薄云疏雨不成泥。送君何处古台西。 废沼夜来秋水满,茂林深处晚莺啼。行人肠断草凄迷。"},"3")]})]})}}return(0,l.jsx)(n,{})},g=function(){class n extends p.Component{constructor(...n){super(...n),(0,t.Z)(this,"state",{activeKey:["1"]})}handleChange(n){this.setState({activeKey:n})}render(){var n=this.state.activeKey;return(0,l.jsxs)(o.U,{activeKey:n,onChange:this.handleChange.bind(this),children:[(0,l.jsx)(o.U.Panel,{title:"南歌子(暮春)",showArrow:!1,children:"紫陌寻春去,红尘拂面来。无人不道看花回。惟见石榴新蕊、一枝开。 冰簟堆云髻,金尊滟玉醅。绿阴青子相催。留取红巾千点、照池台。"},"1"),(0,l.jsx)(o.U.Panel,{title:"沁园春",showArrow:!1,children:"孤馆灯青,野店鸡号,旅枕梦残。渐月华收练,晨霜耿耿,云山摛锦,朝露漙漙。世路无穷,劳生有限,似此区区长鲜欢。微吟罢,凭征鞍无语,往事千端。 当时共客长安。似二陆初来俱少年。有笔头千字,胸中万卷,致君尧舜,此事何难。用舍由时,行藏在我,袖手何妨闲处看。身长健,但优游卒岁,且斗尊前。"},"2"),(0,l.jsx)(o.U.Panel,{title:"浣溪沙",showArrow:!1,children:"缥缈红妆照浅溪。薄云疏雨不成泥。送君何处古台西。 废沼夜来秋水满,茂林深处晚莺啼。行人肠断草凄迷。"},"3")]})}}return(0,l.jsx)(n,{})};function m(n){return(0,l.jsx)(n.tag,i(i({},n.attributes),{},{dangerouslySetInnerHTML:{__html:n.html}}))}function y(n){return(0,l.jsx)(m,{tag:"section",html:n.html,attributes:{className:"zandoc-react-markdown"}})}function v(n){return(0,l.jsx)(m,{tag:"style",html:n.style})}function f(n,a){for(;n;)return n.offsetTop&&"static"!==getComputedStyle(n).position&&(a+=n.offsetTop),f(n.parentNode,a);return a}class C extends p.Component{constructor(...n){super(...n),(0,t.Z)(this,"state",{showCode:!1}),(0,t.Z)(this,"toggle",(()=>{this.setState({showCode:!this.state.showCode})}))}render(){var n=this.state.showCode,a=this.props,s=a.title,t=a.src,p=a.children;return(0,l.jsxs)("div",{className:"zandoc-react-demo",children:[(0,l.jsx)("div",{className:"zandoc-react-demo__preview",children:p}),(0,l.jsxs)("div",{className:"zandoc-react-demo__bottom",onClick:this.toggle,children:[(0,l.jsx)("div",{className:"zandoc-react-demo__title",children:(0,l.jsx)("p",{children:s||""})}),(0,l.jsx)("i",{className:"zenticon zenticon-caret-up zandoc-react-demo__toggle ".concat(n?"zandoc-react-demo__toggle-on":"zandoc-react-demo__toggle-off")})]}),n&&(0,l.jsx)("pre",{className:"zandoc-react-demo__code",children:(0,l.jsx)(m,{tag:"code",html:t,attributes:{className:"language-jsx"}})})]})}}class b extends p.Component{componentDidMount(){var n=location.hash;if(n){var a=document.querySelector('a[href="'.concat(n,'"]'));a&&(0,e.l)(document.documentElement,0,f(a,-9))}}render(){return p.createElement("div",{className:"zandoc-react-container"},p.createElement(v,{style:""}),p.createElement(y,{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="#jian-yi">¶</a><a href="javascript:void(0)" id="jian-yi" class="anchor-point"></a>建议</h3>\n<ul>\n<li>对内容较多的信息进行分组和隐藏,提高页面阅读效率与美观,常用于 QA、帮助文档等;</li>\n<li>当多组信息结构统一,如多组 标题+多行文本/图文 结构;</li>\n</ul>\n<h3 class="anchor-heading"><a href="#zhu-yi">¶</a><a href="javascript:void(0)" id="zhu-yi" class="anchor-point"></a>注意</h3>\n<ul>\n<li>信息组数量小于 2 组时或信息结构只有一级时折叠面板不适用;</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>'}),p.createElement(C,{title:"基础用法",id:"Demonoborder",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Collapse</span> <span class="token punctuation">}</span></span> <span class="token keyword module">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 <span class="token literal-property property">activeKey</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token string">\'1\'</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">handleChange</span> <span class="token operator">=</span> <span class="token parameter">activeKey</span> <span class="token arrow operator">=></span> <span class="token punctuation">{</span>\n <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token method function property-access">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">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><span class="token property-access">state</span><span class="token punctuation">;</span>\n\n <span class="token keyword control-flow">return</span> <span class="token punctuation">(</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Collapse</span></span>\n <span class="token attr-name">panelTitleBackground</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>no<span class="token punctuation">"</span></span>\n <span class="token attr-name">activeKey</span><span class="token script language-javascript"><span class="token script-punctuation 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 script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span><span class="token property-access">handleChange</span><span class="token punctuation">}</span></span>\n <span class="token attr-name">bordered</span><span class="token script language-javascript"><span class="token script-punctuation 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><span class="token class-name">Collapse.Panel</span></span>\n <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>南歌子(暮春)<span class="token punctuation">"</span></span>\n <span class="token attr-name">key</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>1<span class="token punctuation">"</span></span>\n <span class="token attr-name">extra</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>a</span><span class="token punctuation">></span></span>自定义内容<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>a</span><span class="token punctuation">></span></span><span class="token punctuation">}</span></span>\n <span class="token punctuation">></span></span>\n 紫陌寻春去,红尘拂面来。无人不道看花回。惟见石榴新蕊、一枝开。 冰簟堆云髻,金尊滟玉醅。绿阴青子相催。留取红巾千点、照池台。\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Collapse.Panel</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Collapse.Panel</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</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 attr-equals">=</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><span class="token class-name">Collapse.Panel</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Collapse.Panel</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</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 attr-equals">=</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><span class="token class-name">Collapse.Panel</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Collapse</span></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\n<span class="token maybe-class-name">ReactDOM</span><span class="token punctuation">.</span><span class="token method function property-access">render</span><span class="token punctuation">(</span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Simple</span></span> <span class="token punctuation">/></span></span><span class="token punctuation">,</span> mountNode<span class="token punctuation">)</span><span class="token punctuation">;</span>'},p.createElement(k)),p.createElement(C,{title:"手风琴风格,每次只能打开一个面板。",id:"Demoaccordion",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Collapse</span> <span class="token punctuation">}</span></span> <span class="token keyword module">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 <span class="token literal-property property">activeKey</span><span class="token operator">:</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><span class="token parameter">activeKey</span><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 method function property-access">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><span class="token property-access">state</span><span class="token punctuation">;</span>\n <span class="token keyword control-flow">return</span> <span class="token punctuation">(</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Collapse</span></span>\n <span class="token attr-name">bordered</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token boolean">false</span><span class="token punctuation">}</span></span>\n <span class="token attr-name">panelTitleBackground</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>no<span class="token punctuation">"</span></span>\n <span class="token attr-name">activeKey</span><span class="token script language-javascript"><span class="token script-punctuation 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 script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span><span class="token method function property-access">handleChange</span><span class="token punctuation">.</span><span class="token method function property-access">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><span class="token class-name">Collapse.Panel</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</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 attr-equals">=</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><span class="token class-name">Collapse.Panel</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Collapse.Panel</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</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 attr-equals">=</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><span class="token class-name">Collapse.Panel</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Collapse.Panel</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</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 attr-equals">=</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><span class="token class-name">Collapse.Panel</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Collapse</span></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\n<span class="token maybe-class-name">ReactDOM</span><span class="token punctuation">.</span><span class="token method function property-access">render</span><span class="token punctuation">(</span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Simple</span></span> <span class="token punctuation">/></span></span><span class="token punctuation">,</span> mountNode<span class="token punctuation">)</span><span class="token punctuation">;</span>'},p.createElement(r)),p.createElement(C,{title:"显示内容区底色",id:"Demoshowcontentbg",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Collapse</span> <span class="token punctuation">}</span></span> <span class="token keyword module">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 <span class="token literal-property property">activeKey</span><span class="token operator">:</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-variable function">handleChange</span> <span class="token operator">=</span> <span class="token parameter">activeKey</span> <span class="token arrow operator">=></span> <span class="token punctuation">{</span>\n <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token method function property-access">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">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><span class="token property-access">state</span><span class="token punctuation">;</span>\n\n <span class="token keyword control-flow">return</span> <span class="token punctuation">(</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Collapse</span></span>\n <span class="token attr-name">panelTitleBackground</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>no<span class="token punctuation">"</span></span>\n <span class="token attr-name">showContentBackground</span>\n <span class="token attr-name">activeKey</span><span class="token script language-javascript"><span class="token script-punctuation 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 script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span><span class="token property-access">handleChange</span><span class="token punctuation">}</span></span>\n <span class="token attr-name">bordered</span><span class="token script language-javascript"><span class="token script-punctuation 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><span class="token class-name">Collapse.Panel</span></span>\n <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>南歌子(暮春)<span class="token punctuation">"</span></span>\n <span class="token attr-name">key</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>1<span class="token punctuation">"</span></span>\n <span class="token attr-name">extra</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>a</span><span class="token punctuation">></span></span>自定义内容<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>a</span><span class="token punctuation">></span></span><span class="token punctuation">}</span></span>\n <span class="token punctuation">></span></span>\n 紫陌寻春去,红尘拂面来。无人不道看花回。惟见石榴新蕊、一枝开。 冰簟堆云髻,金尊滟玉醅。绿阴青子相催。留取红巾千点、照池台。\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Collapse.Panel</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Collapse.Panel</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</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 attr-equals">=</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><span class="token class-name">Collapse.Panel</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Collapse.Panel</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</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 attr-equals">=</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><span class="token class-name">Collapse.Panel</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Collapse</span></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\n<span class="token maybe-class-name">ReactDOM</span><span class="token punctuation">.</span><span class="token method function property-access">render</span><span class="token punctuation">(</span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Simple</span></span> <span class="token punctuation">/></span></span><span class="token punctuation">,</span> mountNode<span class="token punctuation">)</span><span class="token punctuation">;</span>'},p.createElement(d)),p.createElement(y,{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<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<td></td>\n</tr>\n<tr>\n<td>activeKey</td>\n<td>当前打开的面板 id</td>\n<td><code>string | string[]</code>\n(注意手风琴模式时类型才为 \n<code>string</code>\n,否则类型为 \n<code>string[]</code>\n)</td>\n<td>否</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<td></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<td></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<td></td>\n</tr>\n<tr>\n<td>showContentBackground</td>\n<td>是否显示 Panel 内容区底色</td>\n<td><code>boolean</code></td>\n<td>否</td>\n<td><code>\'false\'</code></td>\n<td><code>\'true\'</code></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<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,\n<a href="https://reactjs.org/docs/lists-and-keys.html#keys">React Keys 文档</a></td>\n<td><code>ReactText</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>extra</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</tbody>\n</table>\n<h4 class="anchor-heading"><a href="#yi-xia-gong-neng-xin-ban-she-ji-yu-yan-yi-fei-qi-jin-zuo-wei-lao-ban-shi-yong-de-can-kao">¶</a><a href="javascript:void(0)" id="yi-xia-gong-neng-xin-ban-she-ji-yu-yan-yi-fei-qi-jin-zuo-wei-lao-ban-shi-yong-de-can-kao" class="anchor-point"></a>以下功能新版设计语言已废弃,仅作为老版使用的参考</h4>'}),p.createElement(C,{title:"有边框的",id:"Demobasic",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Collapse</span><span class="token punctuation">,</span> <span class="token maybe-class-name">Switch</span> <span class="token punctuation">}</span></span> <span class="token keyword module">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 <span class="token literal-property property">activeKey</span><span class="token operator">:</span> <span class="token punctuation">[</span><span class="token string">\'1\'</span><span class="token punctuation">]</span><span class="token punctuation">,</span>\n <span class="token literal-property property">bg</span><span class="token operator">:</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> <span class="token parameter">activeKey</span> <span class="token arrow operator">=></span> <span class="token punctuation">{</span>\n <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token method function property-access">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> <span class="token parameter">bg</span> <span class="token arrow operator">=></span> <span class="token punctuation">{</span>\n <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token method function property-access">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><span class="token property-access">state</span><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 operator">:</span> <span class="token string">\'none\'</span><span class="token punctuation">;</span>\n\n <span class="token keyword control-flow">return</span> <span class="token punctuation">(</span>\n <span class="token tag"><span class="token tag"><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>div</span> <span class="token attr-name">style</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token punctuation">{</span> <span class="token literal-property property">marginBottom</span><span class="token operator">:</span> <span class="token number">20</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><span class="token class-name">Switch</span></span>\n <span class="token attr-name">size</span><span class="token attr-value"><span class="token punctuation attr-equals">=</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 script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span><span class="token property-access">state</span><span class="token punctuation">.</span><span class="token property-access">bg</span><span class="token punctuation">}</span></span>\n <span class="token attr-name">onChange</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span><span class="token property-access">handleBgChange</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>span</span><span class="token punctuation">></span></span> <span class="token maybe-class-name">Title</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><span class="token class-name">Collapse</span></span>\n <span class="token attr-name">panelTitleBackground</span><span class="token script language-javascript"><span class="token script-punctuation 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 script-punctuation 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 script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span><span class="token property-access">handleChange</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><span class="token class-name">Collapse.Panel</span></span>\n <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>南歌子(暮春)<span class="token punctuation">"</span></span>\n <span class="token attr-name">key</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>1<span class="token punctuation">"</span></span>\n <span class="token attr-name">extra</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>a</span><span class="token punctuation">></span></span>自定义内容<span class="token tag"><span class="token tag"><span class="token punctuation"></</span>a</span><span class="token punctuation">></span></span><span class="token punctuation">}</span></span>\n <span class="token punctuation">></span></span>\n 紫陌寻春去,红尘拂面来。无人不道看花回。惟见石榴新蕊、一枝开。 冰簟堆云髻,金尊滟玉醅。绿阴青子相催。留取红巾千点、照池台。\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Collapse.Panel</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Collapse.Panel</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</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 attr-equals">=</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><span class="token class-name">Collapse.Panel</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Collapse.Panel</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</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 attr-equals">=</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><span class="token class-name">Collapse.Panel</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Collapse</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span></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\n<span class="token maybe-class-name">ReactDOM</span><span class="token punctuation">.</span><span class="token method function property-access">render</span><span class="token punctuation">(</span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Simple</span></span> <span class="token punctuation">/></span></span><span class="token punctuation">,</span> mountNode<span class="token punctuation">)</span><span class="token punctuation">;</span>'},p.createElement(h)),p.createElement(C,{title:"无箭头样式",id:"Demonoarrow",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Collapse</span> <span class="token punctuation">}</span></span> <span class="token keyword module">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 <span class="token literal-property property">activeKey</span><span class="token operator">:</span> <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><span class="token parameter">activeKey</span><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 method function property-access">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><span class="token property-access">state</span><span class="token punctuation">;</span>\n <span class="token keyword control-flow">return</span> <span class="token punctuation">(</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Collapse</span></span> <span class="token attr-name">activeKey</span><span class="token script language-javascript"><span class="token script-punctuation 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 script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span><span class="token method function property-access">handleChange</span><span class="token punctuation">.</span><span class="token method function property-access">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><span class="token class-name">Collapse.Panel</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</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 attr-equals">=</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 script-punctuation 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><span class="token class-name">Collapse.Panel</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Collapse.Panel</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</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 attr-equals">=</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 script-punctuation 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><span class="token class-name">Collapse.Panel</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Collapse.Panel</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</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 attr-equals">=</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 script-punctuation 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><span class="token class-name">Collapse.Panel</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Collapse</span></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\n<span class="token maybe-class-name">ReactDOM</span><span class="token punctuation">.</span><span class="token method function property-access">render</span><span class="token punctuation">(</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Simple</span></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>'},p.createElement(g)))}}},31269:(n,a,s)=>{"use strict";s.d(a,{U:()=>f});var t=s(59312),p=s(24246),e=s(27378),o=s(60042),c=s.n(o),l=s(65922),u=s(79737),i=s(12856),k=s(98859),r=s(1348),d=s(31256),h=s(39215),g={borderBottomWidth:0,borderBottomColor:"rgba(255, 255, 255, 0)",transition:"border-bottom-width 200ms "+k.rc+", border-bottom-color 200ms "+k.rc},m={},y=function(n){function a(){var a=null!==n&&n.apply(this,arguments)||this;return a.state={animateAppear:!a.props.active},a.toggle=function(){var n=a.props,s=n.onChange,t=n.panelKey,p=n.active,e=n.disabled;(void 0===e?a.context.value:e)||(0,d.Z)(t)||null==s||s(t,!p)},a}return(0,t.ZT)(a,n),a.prototype.render=function(){var n=this.props,a=n.children,s=n.title,e=n.style,o=n.active,l=n.disabled,r=void 0===l?this.context.value:l,d=n.showArrow,y=n.className,v=n.isLast,f=n.bordered,C=n.extra,b=n.panelTitleBackground,w=n.showContentBackground,j=this.state.animateAppear,x=f&&v,P=x&&!o?g:m,z=x||!o?g:m;return(0,p.jsxs)("div",(0,t.pi)({className:c()("zent-collapse-panel",y,{"zent-collapse-panel--has-arrow":d,"zent-collapse-panel--active":o,"zent-collapse-panel--inactive":!o,"zent-collapse-panel--disabled":r}),style:e,"data-zv":"10.0.10"},{children:[(0,p.jsxs)("div",(0,t.pi)({className:c()("zent-collapse-panel__title",{"zent-collapse-panel__title--bg-none":"none"===b,"zent-collapse-panel__title--bg-default":"default"===b}),style:P,onClick:this.toggle,"data-zv":"10.0.10"},{children:[(0,p.jsxs)("div",(0,t.pi)({className:"zent-collapse-panel__title__content","data-zv":"10.0.10"},{children:[d&&(0,p.jsx)(h.Z,{type:"down",className:"zent-collapse-panel__arrow"},void 0),s]}),void 0),(0,p.jsx)("div",(0,t.pi)({className:"zent-collapse-panel__title__extra","data-zv":"10.0.10"},{children:C}),void 0)]}),void 0),(0,p.jsx)(i.Z,(0,t.pi)({mount:o},{children:(0,p.jsx)(u.H,(0,t.pi)({appear:j,duration:160,height:o?"auto":0,transitionPrototype:"all",easing:o?k.Kc:k.AX,className:c()("zent-collapse-panel__content-box",{"zent-collapse-panel__content-box--inactive":!o,"zent-collapse-panel__content-box--active":o,"zent-collapse-panel__content_box--show-background":w}),style:z},{children:(0,p.jsx)("div",(0,t.pi)({className:"zent-collapse-panel__content","data-zv":"10.0.10"},{children:a}),void 0)}),void 0)}),void 0)]}),void 0)},a.defaultProps={showArrow:!0},a.contextType=r.d,a}(e.Component),v=s(19185),f=function(n){function a(){var a=null!==n&&n.apply(this,arguments)||this;return a.onChange=function(n,s){if(a.props.accordion){var t=a.props,p=t.onChange;(o=t.activeKey)!==n&&s?p(n):o!==n||s||p(null)}else{var e=a.props,o=e.activeKey,c=(p=e.onChange,[].concat(null!=o?o:[])),l=c.indexOf(n);s?-1===l&&c.push(n):-1!==l&&c.splice(l,1),p(c)}},a}return(0,t.ZT)(a,n),a.prototype.render=function(){var n=this,a=this.props,s=a.className,o=a.bordered,u=a.panelTitleBackground,i=a.showContentBackground,k=a.children,r=a.activeKey;return(0,p.jsx)("div",(0,t.pi)({className:c()("zent-collapse",s,{"zent-collapse--has-border":o,"zent-collapse--no-border":!o}),"data-zv":"10.0.10"},{children:e.Children.map(k,(function(a,s){var t;if(!(0,v.isElement)(a)||!(0,l.Z)(a.type,y))throw new Error("Invalid children supplied to Collapse. Each child should be a Panel.");var p=null===(t=a.key)||void 0===t?void 0:t.toString();return(0,e.cloneElement)(a,{onChange:n.onChange,active:C(r,p),panelKey:p,panelTitleBackground:u,showContentBackground:i,isLast:s===e.Children.count(k)-1,bordered:o})}))}),void 0)},a.defaultProps={bordered:!0,panelTitleBackground:"default",accordion:!1},a.Panel=y,a}(e.Component);function C(n,a){return"string"==typeof n?n===a:!!Array.isArray(n)&&void 0!==a&&-1!==n.indexOf(a)}},56377:(n,a,s)=>{"use strict";s.d(a,{r:()=>u});var t=s(59312),p=s(24246),e=s(27378),o=s(60042),c=s.n(o),l=s(1348),u=function(n){function a(){var a=null!==n&&n.apply(this,arguments)||this;return a.toggle=function(){var n=a.props,s=n.onChange,t=n.checked;s&&s(!t)},a}return(0,t.ZT)(a,n),a.prototype.render=function(){var n,a=this.props,s=a.className,t=a.size,e=a.disabled,o=void 0===e?this.context.value:e,l=a.loading,u=a.checked,i=o||l,k=c()(((n={})["zent-switch-"+t]="default"!==t,n["zent-switch-disabled"]=i,n["zent-switch-loading"]=l,n["zent-switch-checked"]=u,n),"zent-switch",s);return(0,p.jsx)("div",{className:k,onClick:i?void 0:this.toggle,"data-zv":"10.0.10"},void 0)},a.defaultProps={size:"default"},a.contextType=l.d,a}(e.Component);a.Z=u},79737:(n,a,s)=>{"use strict";s.d(a,{H:()=>l});var t=s(59312),p=s(24246),e=s(27378),o=s(17127);function c(n,a){n.style.height="number"==typeof a?a+"px":a}var l=function(n){function a(){var a=null!==n&&n.apply(this,arguments)||this;return a.ref=(0,e.createRef)(),a.timer=null,a}return(0,t.ZT)(a,n),a.prototype.componentDidMount=function(){var n=this,a=this.props,s=a.appear,t=a.height,p=a.duration,e=this.ref.current;if(s&&"auto"===t){var l=e.offsetHeight;e.style.height="0px",(0,o.tA)((function(){n.props.height===t&&(e.style.height=l+"px",n.timer=setTimeout((function(){n.timer=null,n.props.height===t&&(e.style.height="auto")}),p))}))}else c(e,t)},a.prototype.componentDidUpdate=function(n){var a=this,s=this.props,t=s.height,p=s.duration;if(n.height!==t){null!==this.timer&&(clearTimeout(this.timer),this.timer=null);var e=this.ref.current;if("auto"===n.height)e.style.height=e.offsetHeight+"px",(0,o.tA)((function(){a.props.height===t&&c(e,t)}));else if("auto"===t){var l=e.offsetHeight;e.style.height="auto";var u=e.offsetHeight;e.style.height=l+"px",(0,o.tA)((function(){e.style.height=u+"px",a.timer=setTimeout((function(){a.timer=null,a.props.height===t&&(e.style.height=t)}),p)}))}else c(e,t)}},a.prototype.render=function(){var n=this.props,a=n.duration,s=n.className,e=n.style,o=n.easing,c=n.overflow,l=n.children,u=n.transitionPrototype;return(0,p.jsx)("div",(0,t.pi)({ref:this.ref,className:s,style:(0,t.pi)((0,t.pi)({},e),{transition:u+" "+a+"ms "+o,overflow:c}),"data-zv":"10.0.10"},{children:l}),void 0)},a.defaultProps={appear:!1,duration:200,easing:"ease",overflow:"hidden",transitionPrototype:"height"},a}(e.Component)},12856:(n,a,s)=>{"use strict";var t=s(59312),p=function(n){function a(a){var s=n.call(this,a)||this;return s.state={mounted:a.mount},s}return(0,t.ZT)(a,n),a.prototype.render=function(){var n=this.props.children;return this.state.mounted?n:null},a.getDerivedStateFromProps=function(n,a){return n.mount&&!a.mounted?{mounted:!0}:null},a.defaultProps={mount:!1},a}(s(27378).Component);a.Z=p},31256:(n,a,s)=>{"use strict";function t(n){return null==n}s.d(a,{Z:()=>t})},65922:(n,a,s)=>{"use strict";function t(n,a){return n===a||(null==n?void 0:n.prototype)instanceof a}s.d(a,{Z:()=>t})},98859:(n,a,s)=>{"use strict";s.d(a,{rc:()=>t,Kc:()=>p,AX:()=>e});var t="cubic-bezier(0.5, 0, 0.5, 0.1)",p="cubic-bezier(0.33, 1, 0.68, 1)",e="cubic-bezier(0.32, 0, 0.67, 0)"}}]);