-
Notifications
You must be signed in to change notification settings - Fork 0
/
42-9c128e7e1f8e9241073d.js
1 lines (1 loc) · 85.4 KB
/
42-9c128e7e1f8e9241073d.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[42],{977:function(n,s,a){"use strict";a.r(s),a.d(s,"default",(function(){return T}));var t=a(846),p=a.n(t),o=a(840),e=a.n(o),c=a(841),l=a.n(c),u=a(521),i=a.n(u),k=a(842),r=a.n(k),d=a(843),m=a.n(d),g=a(844),h=a.n(g),y=a(845),f=a.n(y),v=a(0),w=a.n(v),C=a(210),b=a(145);function j(n){var s=function(){if("undefined"==typeof Reflect||!Reflect.construct)return!1;if(Reflect.construct.sham)return!1;if("function"==typeof Proxy)return!0;try{return Date.prototype.toString.call(Reflect.construct(Date,[],(function(){}))),!0}catch(n){return!1}}();return function(){var a,t=h()(n);if(s){var p=h()(this).constructor;a=Reflect.construct(t,arguments,p)}else a=t.apply(this,arguments);return m()(this,a)}}var N=function(){var n=function(n){r()(a,n);var s=j(a);function a(){var n;e()(this,a);for(var t=arguments.length,p=new Array(t),o=0;o<t;o++)p[o]=arguments[o];return n=s.call.apply(s,[this].concat(p)),f()(i()(n),"state",{value:["330000","330100","330106"],options:[{id:"330000",title:"Zhejiang",children:[{id:"330100",title:"Hangzhou",children:[{id:"330106",title:"Xihu"}]},{id:"330200",title:"Wenzhou",children:[{id:"330206",title:"Longwan"}]}]},{id:"120000",title:"Xinjiang",children:[{id:"120100",title:"Bortala",children:[{id:"120111",title:"Alashankou"}]}]}]}),f()(i()(n),"onChange",(function(s){b.Notify.success(JSON.stringify(s)),n.setState({value:s.map((function(n){return n.id}))})})),n}return l()(a,[{key:"render",value:function(){return w.a.createElement(b.Cascader,{value:this.state.value,options:this.state.options,onChange:this.onChange,title:["Province","City","District"]})}}]),a}(w.a.Component);return w.a.createElement(n,null)},S=function(){var n=function(n){r()(a,n);var s=j(a);function a(){var n;e()(this,a);for(var t=arguments.length,p=new Array(t),o=0;o<t;o++)p[o]=arguments[o];return n=s.call.apply(s,[this].concat(p)),f()(i()(n),"state",{value:["330000","330100","330106"],options:[{id:"330000",title:"Zhejiang",children:[{id:"330100",title:"Hangzhou",children:[{id:"330106",title:"Xihu"}]},{id:"330200",title:"Wenzhou",children:[{id:"330206",title:"Longwan"}]}]},{id:"120000",title:"Xinjiang",children:[{id:"120100",title:"Bortala",children:[{id:"120111",title:"Alashankou"}]}]}]}),f()(i()(n),"onChange",(function(s){b.Notify.success(JSON.stringify(s)),n.setState({value:s.map((function(n){return n.id}))})})),n}return l()(a,[{key:"render",value:function(){return w.a.createElement(b.Cascader,{value:this.state.value,options:this.state.options,onChange:this.onChange,type:"menu",title:["Province","City","District"]})}}]),a}(w.a.Component);return w.a.createElement(n,null)},E=function(){var n=function(n){r()(a,n);var s=j(a);function a(){var n;e()(this,a);for(var t=arguments.length,p=new Array(t),o=0;o<t;o++)p[o]=arguments[o];return n=s.call.apply(s,[this].concat(p)),f()(i()(n),"state",{value:["330000","330100","330106"],options:[{id:"330000",title:"Zhejiang",children:[{id:"330100",title:"Hangzhou",children:[{id:"330106",title:"Xihu"}]}]},{id:"120000",title:"Xinjiang",children:[{id:"120100",title:"Bortala",children:[{id:"120111",title:"Alashankou"}]}]}]}),f()(i()(n),"onChange",(function(s){n.setState({value:s.map((function(n){return n.id}))}),b.Notify.success(JSON.stringify(s))})),n}return l()(a,[{key:"render",value:function(){return w.a.createElement("div",null,w.a.createElement(b.Cascader,{value:this.state.value,options:this.state.options,onChange:this.onChange,changeOnSelect:!0,title:["Province","City","District"]}),w.a.createElement("br",null),w.a.createElement("br",null),w.a.createElement(b.Cascader,{value:this.state.value,displayText:function(n){return n&&n.length>0?n[n.length-1].title:""},options:this.state.options,onChange:this.onChange,changeOnSelect:!0,title:["Province","City","District"]}))}}]),a}(w.a.Component);return w.a.createElement(n,null)},z=function(){var n=function(n){r()(a,n);var s=j(a);function a(){var n;e()(this,a);for(var t=arguments.length,p=new Array(t),o=0;o<t;o++)p[o]=arguments[o];return n=s.call.apply(s,[this].concat(p)),f()(i()(n),"state",{value:[],options:[{id:"330000",title:"Zhejiang",isLeaf:!1},{id:"120000",title:"Xinjiang",isLeaf:!1}]}),f()(i()(n),"loadMore",(function(n,s){return new Promise((function(n,a){setTimeout((function(){var a=s>=2,t=[{id:"66666".concat(s),title:"Label".concat(s),isLeaf:a}];n(t)}),500)}))})),f()(i()(n),"onChange",(function(s){b.Notify.success(JSON.stringify(s)),n.setState({value:s.map((function(n){return n.id}))})})),n}return l()(a,[{key:"render",value:function(){return w.a.createElement(b.Cascader,{value:this.state.value,options:this.state.options,onChange:this.onChange,loadMore:this.loadMore,placeholder:"Please choose",type:"tabs",title:["Province","City","District"]})}}]),a}(w.a.Component);return w.a.createElement(n,null)},D=function(){var n=function(n){r()(a,n);var s=j(a);function a(){var n;e()(this,a);for(var t=arguments.length,p=new Array(t),o=0;o<t;o++)p[o]=arguments[o];return n=s.call.apply(s,[this].concat(p)),f()(i()(n),"state",{value:[],options:[{id:"330000",title:"Zhejiang",isLeaf:!1},{id:"120000",title:"Xinjiang",isLeaf:!1}]}),f()(i()(n),"loadMore",(function(n,s){return new Promise((function(n,a){setTimeout((function(){var a=s>=2,t=[{id:"66666".concat(s),title:"Label".concat(s),isLeaf:a}];n(t)}),500)}))})),f()(i()(n),"onChange",(function(s){b.Notify.success(JSON.stringify(s)),n.setState({value:s.map((function(n){return n.id}))})})),n}return l()(a,[{key:"render",value:function(){return w.a.createElement(b.Cascader,{value:this.state.value,options:this.state.options,onChange:this.onChange,loadMore:this.loadMore,placeholder:"Please choose",type:"menu",title:["Province","City","District"]})}}]),a}(w.a.Component);return w.a.createElement(n,null)},L=function(){var n=function(n){r()(a,n);var s=j(a);function a(){var n;e()(this,a);for(var t=arguments.length,p=new Array(t),o=0;o<t;o++)p[o]=arguments[o];return n=s.call.apply(s,[this].concat(p)),f()(i()(n),"state",{value:["330000","330100","330106"],options:[{id:"330000",title:"Zhejiang",children:[{id:"330100",title:"Hangzhou",children:[{id:"330106",title:"Xihu"}]},{id:"330200",title:"Wenzhou",children:[{id:"330206",title:"Longwan"}]}]},{id:"120000",title:"Xinjiang",children:[{id:"120100",title:"Bortala",children:[{id:"120111",title:"Alashankou"}]}]}]}),f()(i()(n),"onChange",(function(s){b.Notify.success(JSON.stringify(s)),n.setState({value:s.map((function(n){return n.id}))})})),n}return l()(a,[{key:"render",value:function(){return w.a.createElement(b.Cascader,{value:this.state.value,options:this.state.options,onChange:this.onChange,type:"menu",expandTrigger:"hover",title:["Province","City","District"]})}}]),a}(w.a.Component);return w.a.createElement(n,null)},O=function(){var n=function(n){r()(a,n);var s=j(a);function a(){var n;e()(this,a);for(var t=arguments.length,p=new Array(t),o=0;o<t;o++)p[o]=arguments[o];return n=s.call.apply(s,[this].concat(p)),f()(i()(n),"state",{value:["330000","330100","330106"],options:[{id:"330000",title:"Zhejiang",children:[{id:"330100",title:"Hangzhou",children:[{id:"330106",title:"Xihu"}]},{id:"330200",title:"Wenzhou",children:[{id:"330206",title:"Longwan"}]}]},{id:"120000",title:"Xinjiang",children:[{id:"120100",title:"Bortala",children:[{id:"120111",title:"Alashankou"}]}]}]}),f()(i()(n),"onChange",(function(s){b.Notify.success(JSON.stringify(s)),n.setState({value:s.map((function(n){return n.id}))})})),n}return l()(a,[{key:"render",value:function(){return w.a.createElement(b.Cascader,{value:this.state.value,options:this.state.options,onChange:this.onChange,title:["Province","City","District"],disabled:!0})}}]),a}(w.a.Component);return w.a.createElement(n,null)};function P(n){return w.a.createElement(n.tag,p()({},n.attributes,{dangerouslySetInnerHTML:{__html:n.html}}))}function M(n){return w.a.createElement(P,{tag:"section",html:n.html,attributes:{className:"zandoc-react-markdown"}})}function X(n){return w.a.createElement(P,{tag:"style",html:n.style})}var x=function(n){r()(a,n);var s=j(a);function a(){var n;e()(this,a);for(var t=arguments.length,p=new Array(t),o=0;o<t;o++)p[o]=arguments[o];return n=s.call.apply(s,[this].concat(p)),f()(i()(n),"state",{showCode:!1}),f()(i()(n),"toggle",(function(){n.setState({showCode:!n.state.showCode})})),n}return l()(a,[{key:"render",value:function(){var n=this.state.showCode,s=this.props,a=s.title,t=s.src,p=s.children;return w.a.createElement("div",{className:"zandoc-react-demo"},w.a.createElement("div",{className:"zandoc-react-demo__preview"},p),w.a.createElement("div",{className:"zandoc-react-demo__bottom",onClick:this.toggle},w.a.createElement("div",{className:"zandoc-react-demo__title"},w.a.createElement("p",null,a||"")),w.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&&w.a.createElement("pre",{className:"zandoc-react-demo__code"},w.a.createElement(P,{tag:"code",html:t,attributes:{className:"language-jsx"}})))}}]),a}(v.Component),T=function(n){r()(a,n);var s=j(a);function a(){return e()(this,a),s.apply(this,arguments)}return l()(a,[{key:"componentDidMount",value:function(){var n=location.hash;if(n){var s=document.querySelector('a[href="'.concat(n,'"]'));s&&Object(C.a)(document.documentElement,0,function n(s,a){for(;s;)return s.offsetTop&&"static"!==getComputedStyle(s).position&&(a+=s.offsetTop),n(s.parentNode,a);return a}(s,-9))}}},{key:"render",value:function(){return w.a.createElement("div",{className:"zandoc-react-container",key:null},w.a.createElement(X,{style:""}),w.a.createElement(M,{html:'<h2 class="anchor-heading"><a href="#cascader">¶</a><a href="javascript:void(0)" id="cascader" class="anchor-point"></a>Cascader</h2>\n<p>Cascader is used for cascade operation, e.g. cascade location selection.</p>\n<h3 class="anchor-heading"><a href="#demos">¶</a><a href="javascript:void(0)" id="demos" class="anchor-point"></a>Demos</h3>'}),w.a.createElement(x,{title:"Basic Usage",id:"Demobasic",src:'<span class="token keyword module">import</span> <span class="token punctuation">{</span> <span class="token maybe-class-name">Cascader</span><span class="token punctuation">,</span> <span class="token maybe-class-name">Notify</span> <span class="token punctuation">}</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\n state <span class="token operator">=</span> <span class="token punctuation">{</span>\n value<span class="token operator">:</span> <span class="token punctuation">[</span><span class="token string">\'330000\'</span><span class="token punctuation">,</span> <span class="token string">\'330100\'</span><span class="token punctuation">,</span> <span class="token string">\'330106\'</span><span class="token punctuation">]</span><span class="token punctuation">,</span>\n options<span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'330000\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Zhejiang\'</span><span class="token punctuation">,</span>\n children<span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'330100\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Hangzhou\'</span><span class="token punctuation">,</span>\n children<span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'330106\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Xihu\'</span>\n <span class="token punctuation">}</span>\n <span class="token punctuation">]</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'330200\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Wenzhou\'</span><span class="token punctuation">,</span>\n children<span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'330206\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Longwan\'</span>\n <span class="token punctuation">}</span>\n <span class="token punctuation">]</span>\n <span class="token punctuation">}</span>\n <span class="token punctuation">]</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'120000\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Xinjiang\'</span><span class="token punctuation">,</span>\n children<span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'120100\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Bortala\'</span><span class="token punctuation">,</span>\n children<span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'120111\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Alashankou\'</span>\n <span class="token punctuation">}</span>\n <span class="token punctuation">]</span>\n <span class="token punctuation">}</span>\n <span class="token punctuation">]</span>\n <span class="token punctuation">}</span>\n <span class="token punctuation">]</span>\n <span class="token punctuation">}</span>\n\n <span class="token function-variable function">onChange</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token parameter">data</span><span class="token punctuation">)</span> <span class="token arrow operator">=></span> <span class="token punctuation">{</span>\n <span class="token maybe-class-name">Notify</span><span class="token punctuation">.</span><span class="token method function property-access">success</span><span class="token punctuation">(</span><span class="token known-class-name class-name">JSON</span><span class="token punctuation">.</span><span class="token method function property-access">stringify</span><span class="token punctuation">(</span>data<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>\n\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 value<span class="token operator">:</span> data<span class="token punctuation">.</span><span class="token method function property-access">map</span><span class="token punctuation">(</span><span class="token parameter">item</span> <span class="token arrow operator">=></span> item<span class="token punctuation">.</span><span class="token property-access">id</span><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">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">Cascader</span></span>\n <span class="token attr-name">value</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">value</span><span class="token punctuation">}</span></span>\n <span class="token attr-name">options</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">options</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">onChange</span><span class="token punctuation">}</span></span>\n <span class="token attr-name">title</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token punctuation">[</span>\n <span class="token string">\'Province\'</span><span class="token punctuation">,</span>\n <span class="token string">\'City\'</span><span class="token punctuation">,</span>\n <span class="token string">\'District\'</span>\n <span class="token punctuation">]</span><span class="token punctuation">}</span></span>\n <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>\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>'},w.a.createElement(N)),w.a.createElement(x,{title:"menu type ui",id:"Demotype",src:'<span class="token keyword module">import</span> <span class="token punctuation">{</span> <span class="token maybe-class-name">Cascader</span><span class="token punctuation">,</span> <span class="token maybe-class-name">Notify</span> <span class="token punctuation">}</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\n state <span class="token operator">=</span> <span class="token punctuation">{</span>\n value<span class="token operator">:</span> <span class="token punctuation">[</span><span class="token string">\'330000\'</span><span class="token punctuation">,</span> <span class="token string">\'330100\'</span><span class="token punctuation">,</span> <span class="token string">\'330106\'</span><span class="token punctuation">]</span><span class="token punctuation">,</span>\n options<span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'330000\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Zhejiang\'</span><span class="token punctuation">,</span>\n children<span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'330100\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Hangzhou\'</span><span class="token punctuation">,</span>\n children<span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'330106\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Xihu\'</span>\n <span class="token punctuation">}</span>\n <span class="token punctuation">]</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'330200\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Wenzhou\'</span><span class="token punctuation">,</span>\n children<span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'330206\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Longwan\'</span>\n <span class="token punctuation">}</span>\n <span class="token punctuation">]</span>\n <span class="token punctuation">}</span>\n <span class="token punctuation">]</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'120000\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Xinjiang\'</span><span class="token punctuation">,</span>\n children<span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'120100\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Bortala\'</span><span class="token punctuation">,</span>\n children<span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'120111\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Alashankou\'</span>\n <span class="token punctuation">}</span>\n <span class="token punctuation">]</span>\n <span class="token punctuation">}</span>\n <span class="token punctuation">]</span>\n <span class="token punctuation">}</span>\n <span class="token punctuation">]</span>\n <span class="token punctuation">}</span>\n\n <span class="token function-variable function">onChange</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token parameter">data</span><span class="token punctuation">)</span> <span class="token arrow operator">=></span> <span class="token punctuation">{</span>\n <span class="token maybe-class-name">Notify</span><span class="token punctuation">.</span><span class="token method function property-access">success</span><span class="token punctuation">(</span><span class="token known-class-name class-name">JSON</span><span class="token punctuation">.</span><span class="token method function property-access">stringify</span><span class="token punctuation">(</span>data<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>\n\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 value<span class="token operator">:</span> data<span class="token punctuation">.</span><span class="token method function property-access">map</span><span class="token punctuation">(</span><span class="token parameter">item</span> <span class="token arrow operator">=></span> item<span class="token punctuation">.</span><span class="token property-access">id</span><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">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">Cascader</span></span>\n <span class="token attr-name">value</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">value</span><span class="token punctuation">}</span></span>\n <span class="token attr-name">options</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">options</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">onChange</span><span class="token punctuation">}</span></span>\n <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">\'</span>menu<span class="token punctuation">\'</span></span>\n <span class="token attr-name">title</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token punctuation">[</span>\n <span class="token string">\'Province\'</span><span class="token punctuation">,</span>\n <span class="token string">\'City\'</span><span class="token punctuation">,</span>\n <span class="token string">\'District\'</span>\n <span class="token punctuation">]</span><span class="token punctuation">}</span></span>\n <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>\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>'},w.a.createElement(S)),w.a.createElement(x,{title:"Change at any seleted",id:"Demochoosen",src:'<span class="token keyword module">import</span> <span class="token punctuation">{</span> <span class="token maybe-class-name">Cascader</span><span class="token punctuation">,</span> <span class="token maybe-class-name">Notify</span> <span class="token punctuation">}</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\n state <span class="token operator">=</span> <span class="token punctuation">{</span>\n value<span class="token operator">:</span> <span class="token punctuation">[</span><span class="token string">\'330000\'</span><span class="token punctuation">,</span> <span class="token string">\'330100\'</span><span class="token punctuation">,</span> <span class="token string">\'330106\'</span><span class="token punctuation">]</span><span class="token punctuation">,</span>\n options<span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'330000\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Zhejiang\'</span><span class="token punctuation">,</span>\n children<span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'330100\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Hangzhou\'</span><span class="token punctuation">,</span>\n children<span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'330106\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Xihu\'</span>\n <span class="token punctuation">}</span>\n <span class="token punctuation">]</span>\n <span class="token punctuation">}</span>\n <span class="token punctuation">]</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'120000\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Xinjiang\'</span><span class="token punctuation">,</span>\n children<span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'120100\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Bortala\'</span><span class="token punctuation">,</span>\n children<span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'120111\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Alashankou\'</span>\n <span class="token punctuation">}</span>\n <span class="token punctuation">]</span>\n <span class="token punctuation">}</span>\n <span class="token punctuation">]</span>\n <span class="token punctuation">}</span>\n <span class="token punctuation">]</span>\n <span class="token punctuation">}</span>\n\n <span class="token function-variable function">onChange</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token parameter">data</span><span class="token punctuation">)</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 value<span class="token operator">:</span> data<span class="token punctuation">.</span><span class="token method function property-access">map</span><span class="token punctuation">(</span><span class="token parameter">item</span> <span class="token arrow operator">=></span> item<span class="token punctuation">.</span><span class="token property-access">id</span><span class="token punctuation">)</span><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 maybe-class-name">Notify</span><span class="token punctuation">.</span><span class="token method function property-access">success</span><span class="token punctuation">(</span><span class="token known-class-name class-name">JSON</span><span class="token punctuation">.</span><span class="token method function property-access">stringify</span><span class="token punctuation">(</span>data<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">return</span> <span class="token punctuation">(</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">Cascader</span></span>\n <span class="token attr-name">value</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">value</span><span class="token punctuation">}</span></span>\n <span class="token attr-name">options</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">options</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">onChange</span><span class="token punctuation">}</span></span>\n <span class="token attr-name">changeOnSelect</span>\n <span class="token attr-name">title</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token punctuation">[</span>\n <span class="token string">\'Province\'</span><span class="token punctuation">,</span>\n <span class="token string">\'City\'</span><span class="token punctuation">,</span>\n <span class="token string">\'District\'</span>\n <span class="token punctuation">]</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>br</span> <span class="token punctuation">/></span></span><span class="token tag"><span class="token tag"><span class="token punctuation"><</span>br</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">Cascader</span></span>\n <span class="token attr-name">value</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">value</span><span class="token punctuation">}</span></span>\n <span class="token attr-name">displayText</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token parameter">value</span> <span class="token arrow operator">=></span> <span class="token punctuation">(</span>value <span class="token operator">&&</span> value<span class="token punctuation">.</span><span class="token property-access">length</span> <span class="token operator">></span> <span class="token number">0</span> <span class="token operator">?</span> value<span class="token punctuation">[</span>value<span class="token punctuation">.</span><span class="token property-access">length</span> <span class="token operator">-</span> <span class="token number">1</span><span class="token punctuation">]</span><span class="token punctuation">.</span><span class="token property-access">title</span> <span class="token operator">:</span> <span class="token string">\'\'</span><span class="token punctuation">)</span><span class="token punctuation">}</span></span>\n <span class="token attr-name">options</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">options</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">onChange</span><span class="token punctuation">}</span></span>\n <span class="token attr-name">changeOnSelect</span>\n <span class="token attr-name">title</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token punctuation">[</span>\n <span class="token string">\'Province\'</span><span class="token punctuation">,</span>\n <span class="token string">\'City\'</span><span class="token punctuation">,</span>\n <span class="token string">\'District\'</span>\n <span class="token punctuation">]</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>div</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>\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>'},w.a.createElement(E)),w.a.createElement(x,{title:"Dynamic Loading (tabs)",id:"Demodynamic",src:'<span class="token keyword module">import</span> <span class="token punctuation">{</span> <span class="token maybe-class-name">Cascader</span><span class="token punctuation">,</span> <span class="token maybe-class-name">Notify</span> <span class="token punctuation">}</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\n state <span class="token operator">=</span> <span class="token punctuation">{</span>\n value<span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">,</span>\n options<span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'330000\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Zhejiang\'</span><span class="token punctuation">,</span>\n isLeaf<span class="token operator">:</span> <span class="token boolean">false</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'120000\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Xinjiang\'</span><span class="token punctuation">,</span>\n isLeaf<span class="token operator">:</span> <span class="token boolean">false</span>\n <span class="token punctuation">}</span>\n <span class="token punctuation">]</span>\n <span class="token punctuation">}</span>\n\n <span class="token function-variable function">loadMore</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token parameter">root<span class="token punctuation">,</span> stage</span><span class="token punctuation">)</span> <span class="token arrow operator">=></span> <span class="token keyword">new</span> <span class="token class-name">Promise</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token parameter">resolve<span class="token punctuation">,</span> reject</span><span class="token punctuation">)</span> <span class="token arrow operator">=></span> <span class="token punctuation">{</span>\n <span class="token function">setTimeout</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token arrow operator">=></span> <span class="token punctuation">{</span>\n <span class="token keyword">let</span> isLeaf <span class="token operator">=</span> stage <span class="token operator">>=</span> <span class="token number">2</span><span class="token punctuation">;</span>\n <span class="token keyword">let</span> children <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token template-string"><span class="token template-punctuation string">`</span><span class="token string">66666</span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span>stage<span class="token interpolation-punctuation punctuation">}</span></span><span class="token template-punctuation string">`</span></span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token template-string"><span class="token template-punctuation string">`</span><span class="token string">Label</span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span>stage<span class="token interpolation-punctuation punctuation">}</span></span><span class="token template-punctuation string">`</span></span><span class="token punctuation">,</span>\n isLeaf\n <span class="token punctuation">}</span><span class="token punctuation">]</span><span class="token punctuation">;</span>\n <span class="token function">resolve</span><span class="token punctuation">(</span>children<span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token number">500</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">onChange</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token parameter">data</span><span class="token punctuation">)</span> <span class="token arrow operator">=></span> <span class="token punctuation">{</span>\n <span class="token maybe-class-name">Notify</span><span class="token punctuation">.</span><span class="token method function property-access">success</span><span class="token punctuation">(</span><span class="token known-class-name class-name">JSON</span><span class="token punctuation">.</span><span class="token method function property-access">stringify</span><span class="token punctuation">(</span>data<span class="token punctuation">)</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 value<span class="token operator">:</span> data<span class="token punctuation">.</span><span class="token method function property-access">map</span><span class="token punctuation">(</span><span class="token parameter">item</span> <span class="token arrow operator">=></span> item<span class="token punctuation">.</span><span class="token property-access">id</span><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">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">Cascader</span></span>\n <span class="token attr-name">value</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">value</span><span class="token punctuation">}</span></span>\n <span class="token attr-name">options</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">options</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">onChange</span><span class="token punctuation">}</span></span>\n <span class="token attr-name">loadMore</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">loadMore</span><span class="token punctuation">}</span></span>\n <span class="token attr-name">placeholder</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Please choose<span class="token punctuation">"</span></span>\n <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>tabs<span class="token punctuation">"</span></span>\n <span class="token attr-name">title</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token punctuation">[</span>\n <span class="token string">\'Province\'</span><span class="token punctuation">,</span>\n <span class="token string">\'City\'</span><span class="token punctuation">,</span>\n <span class="token string">\'District\'</span>\n <span class="token punctuation">]</span><span class="token punctuation">}</span></span>\n <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>\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>'},w.a.createElement(z)),w.a.createElement(x,{title:"Dynamic Loading (menu)",id:"Demoloading",src:'<span class="token keyword module">import</span> <span class="token punctuation">{</span> <span class="token maybe-class-name">Cascader</span><span class="token punctuation">,</span> <span class="token maybe-class-name">Notify</span> <span class="token punctuation">}</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\n state <span class="token operator">=</span> <span class="token punctuation">{</span>\n value<span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">,</span>\n options<span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'330000\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Zhejiang\'</span><span class="token punctuation">,</span>\n isLeaf<span class="token operator">:</span> <span class="token boolean">false</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'120000\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Xinjiang\'</span><span class="token punctuation">,</span>\n isLeaf<span class="token operator">:</span> <span class="token boolean">false</span>\n <span class="token punctuation">}</span>\n <span class="token punctuation">]</span>\n <span class="token punctuation">}</span>\n\n <span class="token function-variable function">loadMore</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token parameter">root<span class="token punctuation">,</span> stage</span><span class="token punctuation">)</span> <span class="token arrow operator">=></span> <span class="token keyword">new</span> <span class="token class-name">Promise</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token parameter">resolve<span class="token punctuation">,</span> reject</span><span class="token punctuation">)</span> <span class="token arrow operator">=></span> <span class="token punctuation">{</span>\n <span class="token function">setTimeout</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token arrow operator">=></span> <span class="token punctuation">{</span>\n <span class="token keyword">let</span> isLeaf <span class="token operator">=</span> stage <span class="token operator">>=</span> <span class="token number">2</span><span class="token punctuation">;</span>\n <span class="token keyword">let</span> children <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token template-string"><span class="token template-punctuation string">`</span><span class="token string">66666</span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span>stage<span class="token interpolation-punctuation punctuation">}</span></span><span class="token template-punctuation string">`</span></span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token template-string"><span class="token template-punctuation string">`</span><span class="token string">Label</span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span>stage<span class="token interpolation-punctuation punctuation">}</span></span><span class="token template-punctuation string">`</span></span><span class="token punctuation">,</span>\n isLeaf\n <span class="token punctuation">}</span><span class="token punctuation">]</span><span class="token punctuation">;</span>\n <span class="token function">resolve</span><span class="token punctuation">(</span>children<span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token number">500</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">onChange</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token parameter">data</span><span class="token punctuation">)</span> <span class="token arrow operator">=></span> <span class="token punctuation">{</span>\n <span class="token maybe-class-name">Notify</span><span class="token punctuation">.</span><span class="token method function property-access">success</span><span class="token punctuation">(</span><span class="token known-class-name class-name">JSON</span><span class="token punctuation">.</span><span class="token method function property-access">stringify</span><span class="token punctuation">(</span>data<span class="token punctuation">)</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 value<span class="token operator">:</span> data<span class="token punctuation">.</span><span class="token method function property-access">map</span><span class="token punctuation">(</span><span class="token parameter">item</span> <span class="token arrow operator">=></span> item<span class="token punctuation">.</span><span class="token property-access">id</span><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">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">Cascader</span></span>\n <span class="token attr-name">value</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">value</span><span class="token punctuation">}</span></span>\n <span class="token attr-name">options</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">options</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">onChange</span><span class="token punctuation">}</span></span>\n <span class="token attr-name">loadMore</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">loadMore</span><span class="token punctuation">}</span></span>\n <span class="token attr-name">placeholder</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>Please choose<span class="token punctuation">"</span></span>\n <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>menu<span class="token punctuation">"</span></span>\n <span class="token attr-name">title</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token punctuation">[</span>\n <span class="token string">\'Province\'</span><span class="token punctuation">,</span>\n <span class="token string">\'City\'</span><span class="token punctuation">,</span>\n <span class="token string">\'District\'</span>\n <span class="token punctuation">]</span><span class="token punctuation">}</span></span>\n <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>\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>'},w.a.createElement(D)),w.a.createElement(x,{title:"expand trigger type",id:"Demoexpand",src:'<span class="token keyword module">import</span> <span class="token punctuation">{</span> <span class="token maybe-class-name">Cascader</span><span class="token punctuation">,</span> <span class="token maybe-class-name">Notify</span> <span class="token punctuation">}</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\n state <span class="token operator">=</span> <span class="token punctuation">{</span>\n value<span class="token operator">:</span> <span class="token punctuation">[</span><span class="token string">\'330000\'</span><span class="token punctuation">,</span> <span class="token string">\'330100\'</span><span class="token punctuation">,</span> <span class="token string">\'330106\'</span><span class="token punctuation">]</span><span class="token punctuation">,</span>\n options<span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'330000\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Zhejiang\'</span><span class="token punctuation">,</span>\n children<span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'330100\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Hangzhou\'</span><span class="token punctuation">,</span>\n children<span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'330106\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Xihu\'</span>\n <span class="token punctuation">}</span>\n <span class="token punctuation">]</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'330200\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Wenzhou\'</span><span class="token punctuation">,</span>\n children<span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'330206\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Longwan\'</span>\n <span class="token punctuation">}</span>\n <span class="token punctuation">]</span>\n <span class="token punctuation">}</span>\n <span class="token punctuation">]</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'120000\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Xinjiang\'</span><span class="token punctuation">,</span>\n children<span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'120100\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Bortala\'</span><span class="token punctuation">,</span>\n children<span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'120111\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Alashankou\'</span>\n <span class="token punctuation">}</span>\n <span class="token punctuation">]</span>\n <span class="token punctuation">}</span>\n <span class="token punctuation">]</span>\n <span class="token punctuation">}</span>\n <span class="token punctuation">]</span>\n <span class="token punctuation">}</span>\n\n <span class="token function-variable function">onChange</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token parameter">data</span><span class="token punctuation">)</span> <span class="token arrow operator">=></span> <span class="token punctuation">{</span>\n <span class="token maybe-class-name">Notify</span><span class="token punctuation">.</span><span class="token method function property-access">success</span><span class="token punctuation">(</span><span class="token known-class-name class-name">JSON</span><span class="token punctuation">.</span><span class="token method function property-access">stringify</span><span class="token punctuation">(</span>data<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>\n\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 value<span class="token operator">:</span> data<span class="token punctuation">.</span><span class="token method function property-access">map</span><span class="token punctuation">(</span><span class="token parameter">item</span> <span class="token arrow operator">=></span> item<span class="token punctuation">.</span><span class="token property-access">id</span><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">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">Cascader</span></span>\n <span class="token attr-name">value</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">value</span><span class="token punctuation">}</span></span>\n <span class="token attr-name">options</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">options</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">onChange</span><span class="token punctuation">}</span></span>\n <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">\'</span>menu<span class="token punctuation">\'</span></span>\n <span class="token attr-name">expandTrigger</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token string">\'hover\'</span><span class="token punctuation">}</span></span>\n <span class="token attr-name">title</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token punctuation">[</span>\n <span class="token string">\'Province\'</span><span class="token punctuation">,</span>\n <span class="token string">\'City\'</span><span class="token punctuation">,</span>\n <span class="token string">\'District\'</span>\n <span class="token punctuation">]</span><span class="token punctuation">}</span></span>\n <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>\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>'},w.a.createElement(L)),w.a.createElement(x,{title:"Basic Usage",id:"Demodisabled",src:'<span class="token keyword module">import</span> <span class="token punctuation">{</span> <span class="token maybe-class-name">Cascader</span><span class="token punctuation">,</span> <span class="token maybe-class-name">Notify</span> <span class="token punctuation">}</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\n state <span class="token operator">=</span> <span class="token punctuation">{</span>\n value<span class="token operator">:</span> <span class="token punctuation">[</span><span class="token string">\'330000\'</span><span class="token punctuation">,</span> <span class="token string">\'330100\'</span><span class="token punctuation">,</span> <span class="token string">\'330106\'</span><span class="token punctuation">]</span><span class="token punctuation">,</span>\n options<span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'330000\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Zhejiang\'</span><span class="token punctuation">,</span>\n children<span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'330100\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Hangzhou\'</span><span class="token punctuation">,</span>\n children<span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'330106\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Xihu\'</span>\n <span class="token punctuation">}</span>\n <span class="token punctuation">]</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'330200\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Wenzhou\'</span><span class="token punctuation">,</span>\n children<span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'330206\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Longwan\'</span>\n <span class="token punctuation">}</span>\n <span class="token punctuation">]</span>\n <span class="token punctuation">}</span>\n <span class="token punctuation">]</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'120000\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Xinjiang\'</span><span class="token punctuation">,</span>\n children<span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'120100\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Bortala\'</span><span class="token punctuation">,</span>\n children<span class="token operator">:</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'120111\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Alashankou\'</span>\n <span class="token punctuation">}</span>\n <span class="token punctuation">]</span>\n <span class="token punctuation">}</span>\n <span class="token punctuation">]</span>\n <span class="token punctuation">}</span>\n <span class="token punctuation">]</span>\n <span class="token punctuation">}</span>\n\n <span class="token function-variable function">onChange</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token parameter">data</span><span class="token punctuation">)</span> <span class="token arrow operator">=></span> <span class="token punctuation">{</span>\n <span class="token maybe-class-name">Notify</span><span class="token punctuation">.</span><span class="token method function property-access">success</span><span class="token punctuation">(</span><span class="token known-class-name class-name">JSON</span><span class="token punctuation">.</span><span class="token method function property-access">stringify</span><span class="token punctuation">(</span>data<span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">;</span>\n\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 value<span class="token operator">:</span> data<span class="token punctuation">.</span><span class="token method function property-access">map</span><span class="token punctuation">(</span><span class="token parameter">item</span> <span class="token arrow operator">=></span> item<span class="token punctuation">.</span><span class="token property-access">id</span><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">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">Cascader</span></span>\n <span class="token attr-name">value</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">value</span><span class="token punctuation">}</span></span>\n <span class="token attr-name">options</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">options</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">onChange</span><span class="token punctuation">}</span></span>\n <span class="token attr-name">title</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token punctuation">[</span>\n <span class="token string">\'Province\'</span><span class="token punctuation">,</span>\n <span class="token string">\'City\'</span><span class="token punctuation">,</span>\n <span class="token string">\'District\'</span>\n <span class="token punctuation">]</span><span class="token punctuation">}</span></span>\n <span class="token attr-name">disabled</span>\n <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>\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>'},w.a.createElement(O)),w.a.createElement(M,{html:"<h3 class=\"anchor-heading\"><a href=\"#api\">¶</a><a href=\"javascript:void(0)\" id=\"api\" class=\"anchor-point\"></a>API</h3>\n<table class=\"table\">\n<thead>\n<tr>\n<th>Props</th>\n<th>Description</th>\n<th>Type</th>\n<th>Default</th>\n<th>Alternatives</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>value</td>\n<td>The selected value</td>\n<td>array</td>\n<td>[]</td>\n<td>''</td>\n</tr>\n<tr>\n<td>type</td>\n<td>UI type, tab style or menu style</td>\n<td>string</td>\n<td>'tabs'</td>\n<td>'menu'</td>\n</tr>\n<tr>\n<td>options</td>\n<td>Optional data source</td>\n<td>array</td>\n<td>[]</td>\n<td>''</td>\n</tr>\n<tr>\n<td>title</td>\n<td>Title of tab, tab title default is \n<code>'Title'</code></td>\n<td>array</td>\n<td>[]</td>\n<td>''</td>\n</tr>\n<tr>\n<td>onChange</td>\n<td>The callback when data changes</td>\n<td>func</td>\n<td>noop</td>\n<td>''</td>\n</tr>\n<tr>\n<td>loadMore</td>\n<td>Function to load data dynamicly, must return Promise</td>\n<td>func</td>\n<td>-</td>\n<td>''</td>\n</tr>\n<tr>\n<td>changeOnSelect</td>\n<td>Wether trigger change once sth. is seleted</td>\n<td>boolean</td>\n<td>false</td>\n<td>''</td>\n</tr>\n<tr>\n<td>expandTrigger</td>\n<td>Secondary menu expand trigger type. Optional 'click' 和 'hover'. only for type='menu'</td>\n<td>string</td>\n<td>'click'</td>\n<td>'hover'</td>\n</tr>\n<tr>\n<td>placeholder</td>\n<td>The placeholder text of input box</td>\n<td>string</td>\n<td>'Please choose'</td>\n<td>''</td>\n</tr>\n<tr>\n<td>className</td>\n<td>custom classname</td>\n<td>string</td>\n<td>''</td>\n<td>''</td>\n</tr>\n<tr>\n<td>popClassName</td>\n<td>custom classname of popover</td>\n<td>string</td>\n<td>''zent-cascader__popup''</td>\n<td>''</td>\n</tr>\n<tr>\n<td>displayText</td>\n<td>function to customize the display text, selectedOptionArray => text</td>\n<td>func</td>\n<td>-</td>\n<td></td>\n</tr>\n<tr>\n<td>disabled</td>\n<td>whether disabled select</td>\n<td>boolean</td>\n<td>false</td>\n<td>true</td>\n</tr>\n</tbody>\n</table>\n<ul>\n<li>The source data can be fully passed with <code>options</code> or dynamic loaded.</li>\n<li>The <code>root</code> parameter is data object of current clicked element, and <code>stage</code> parameter is the level number when load data throught <code>loadMore</code>.</li>\n<li>The <code>isLeaf</code> paramter is used for <code>loadMore</code>. It controls wether click on the node triggers a request.</li>\n</ul>"}))}}]),a}(v.Component)}}]);