-
Notifications
You must be signed in to change notification settings - Fork 0
/
144-9c128e7e1f8e9241073d.js
1 lines (1 loc) · 83.1 KB
/
144-9c128e7e1f8e9241073d.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[144],{974:function(n,a,s){"use strict";s.r(a),s.d(a,"default",(function(){return A}));var t=s(846),p=s.n(t),e=s(847),o=s.n(e),c=s(840),l=s.n(c),u=s(841),r=s.n(u),i=s(521),k=s.n(i),d=s(842),m=s.n(d),h=s(843),y=s.n(h),g=s(844),f=s.n(g),b=s(845),w=s.n(b),v=s(0),E=s.n(v),D=s(210),T=s(145);function z(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 C(n){for(var a=1;a<arguments.length;a++){var s=null!=arguments[a]?arguments[a]:{};a%2?z(Object(s),!0).forEach((function(a){w()(n,a,s[a])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(s)):z(Object(s)).forEach((function(a){Object.defineProperty(n,a,Object.getOwnPropertyDescriptor(s,a))}))}return n}function j(n){var a=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 s,t=f()(n);if(a){var p=f()(this).constructor;s=Reflect.construct(t,arguments,p)}else s=t.apply(this,arguments);return y()(this,s)}}var I=function(){return E.a.createElement(T.Tree,{data:[{id:1,title:"Hangzhou Youzan Technology Co. Ltd",children:[{id:2,title:"Engineer",children:[{id:3,title:"Back End Engineer"},{id:4,title:"Front End Engineer"},{id:5,title:"Operations Engineer"}]},{id:6,title:"Product"}]}]})},O=function(){return E.a.createElement(T.Tree,{dataType:"plain",data:[{id:1,title:"Hangzhou Youzan Technology Co. Ltd"},{id:2,title:"Engineer",parentId:1},{id:3,title:"Back End Engineer",parentId:2},{id:4,title:"Front End Engineer",parentId:2},{id:5,title:"Operations Engineer",parentId:2},{id:6,title:"Product",parentId:1}]})},R=function(){var n=[{id:1,title:"Hangzhou Youzan Technology Co. Ltd",children:[{id:2,title:"Engineer",children:[{id:3,title:"Back End Engineer"},{id:4,title:"Front End Engineer"},{id:5,title:"Operations Engineer"}]},{id:6,title:"Product"}]}];return E.a.createElement("div",null,E.a.createElement(T.Tree,{data:n,size:"small"}),E.a.createElement(T.Tree,{data:n}),E.a.createElement(T.Tree,{data:n,size:"large"}))},S=function(){var n=[{id:1,title:"Hangzhou Youzan Technology Co. Ltd",content:"great company",children:[{id:2,title:"Engineer",content:"job http://job.youzan.com",children:[{id:3,title:"Back End Engineer"},{id:4,title:"Front End Engineer"},{id:5,title:"Operations Engineer"}]},{id:6,title:"Product",content:E.a.createElement("a",{href:"http://job.youzan.com"},"'send resume to [email protected]'")}]}];return E.a.createElement(T.Tree,{data:n,render:function(n){return E.a.createElement("span",{style:{fontSize:16,margin:0,lineHeight:1}},n.title,n.content?E.a.createElement("small",{style:{display:"block",fontSize:10}},n.content):"")}})},P=function(){var n=T.Radio.Group,a=[{id:1,title:"Hangzhou Youzan Technology Co. Ltd"},{id:2,title:"Engineer",parentId:1},{id:3,title:"Back End Engineer",parentId:2},{id:4,title:"Front End Engineer",parentId:2},{id:5,title:"Operations Engineer",parentId:2},{id:6,title:"Product",parentId:1}],s=function n(a){var s=arguments.length>1&&void 0!==arguments[1]?arguments[1]:0,t=arguments.length>2&&void 0!==arguments[2]?arguments[2]:[],p={id:String(Math.random()).replace("0.",""),parentId:s,title:a.title};t.push(p);for(var e=0,o=a.children&&a.children.length||0;e<o;e++)n(a.children[e],p.id,t);return t},t=function(t){m()(e,t);var p=j(e);function e(){var n;l()(this,e);for(var t=arguments.length,c=new Array(t),u=0;u<t;u++)c[u]=arguments[u];return n=p.call.apply(p,[this].concat(c)),w()(k()(n),"state",{treeData:a,copyType:"shallow"}),w()(k()(n),"onDelete",(function(a){n.setState({treeData:n.state.treeData.filter((function(n){return n.id!==a.id}))})})),w()(k()(n),"onClone",(function(a){var t=n.state.copyType;if("shallow"===t){var p=Object.assign({},a,{id:Date.now()});n.setState({treeData:[].concat(o()(n.state.treeData),[p])})}else if("deep"===t){var e=s(a,a.parentId);n.setState({treeData:[].concat(o()(n.state.treeData),o()(e))})}})),w()(k()(n),"onCopyTypeChange",(function(a){return n.setState({copyType:a.target.value})})),n}return r()(e,[{key:"render",value:function(){var a=this.state,s=a.copyType,t=a.treeData,p=[{name:"Delete",icon:E.a.createElement(T.Icon,{type:"close"}),action:this.onDelete},{name:"Clone",icon:E.a.createElement(T.Icon,{type:"plus"}),action:this.onClone}];return E.a.createElement("div",null,E.a.createElement(n,{onChange:this.onCopyTypeChange,value:s},E.a.createElement(T.Radio,{value:"shallow"},"浅拷贝"),E.a.createElement(T.Radio,{value:"deep"},"深拷贝")),E.a.createElement("hr",null),E.a.createElement(T.Tree,{data:t,dataType:"plain",operations:p}))}}]),e}(E.a.Component);return E.a.createElement(t,null)},N=function(){var n=[{id:1,title:"Hangzhou Youzan Technology Co. Ltd",children:[{id:2,title:"Engineer",children:[{id:3,title:"Back End Engineer",children:[{id:7,title:"JAVA"},{id:8,title:"PHP"},{id:9,title:"GO"},{id:10,title:".NET"}]},{id:4,title:"Front End Engineer"},{id:5,title:"Operations Engineer"}]},{id:6,title:"Product"}]}],a=function(a){m()(t,a);var s=j(t);function t(){var n;l()(this,t);for(var a=arguments.length,p=new Array(a),e=0;e<a;e++)p[e]=arguments[e];return n=s.call.apply(s,[this].concat(p)),w()(k()(n),"state",{checkedKeys:[3,5,22],disabledCheckedKeys:[4,7,9,22]}),w()(k()(n),"onCheck",(function(a,s){console.log(a,s),n.setState({checkedKeys:a})})),n}return r()(t,[{key:"render",value:function(){var a=this.state,s=a.checkedKeys,t=a.disabledCheckedKeys;return E.a.createElement("div",null,E.a.createElement(T.Tree,{checkable:!0,size:"small",data:n,onCheck:this.onCheck,checkedKeys:s,disabledCheckedKeys:t}))}}]),t}(E.a.Component);return E.a.createElement(a,null)},x=function(){var n=function(n,a){n.level<4?setTimeout((function(){for(var s=[],t=Number(n.title.split("-")[0]),p=Math.pow(10,3-n.level),e=n.level+1,o=0,c="",l=!1;o<=9;o++)4===e?(c=String(t+o),l=!0):(c="".concat(t+p*o,"-").concat(t+p*(o+1)),l=!1),s.push({id:c,level:e,title:c,isLeaf:l});a(s)}),200):setTimeout((function(){return a([])}),200)},a=function(a){m()(t,a);var s=j(t);function t(){var a;l()(this,t);for(var p=arguments.length,e=new Array(p),c=0;c<p;c++)e[c]=arguments[c];return a=s.call.apply(s,[this].concat(e)),w()(k()(a),"state",{treeData:[]}),w()(k()(a),"loadMore",(function(s){return new Promise((function(t,p){n(s,(function(n){var p=n.map((function(n){return C(C({},n),{},{parentId:s.id})}));a.setState({treeData:[].concat(o()(a.state.treeData),o()(p))}),t()}))}))})),a}return r()(t,[{key:"componentDidMount",value:function(){var a=this,s={id:"1-0-10000",title:"0-10000",level:0,expand:!0};n(s,(function(n){var t=n.map((function(n){return C(C({},n),{},{parentId:s.id})}));a.setState({treeData:[s].concat(o()(t))})}))}},{key:"render",value:function(){var n=this.state.treeData;return E.a.createElement(T.Tree,{dataType:"plain",data:n,loadMore:this.loadMore})}}]),t}(E.a.Component);return E.a.createElement(a,null)};function K(n){return E.a.createElement(n.tag,p()({},n.attributes,{dangerouslySetInnerHTML:{__html:n.html}}))}function M(n){return E.a.createElement(K,{tag:"section",html:n.html,attributes:{className:"zandoc-react-markdown"}})}function L(n){return E.a.createElement(K,{tag:"style",html:n.style})}var q=function(n){m()(s,n);var a=j(s);function s(){var n;l()(this,s);for(var t=arguments.length,p=new Array(t),e=0;e<t;e++)p[e]=arguments[e];return n=a.call.apply(a,[this].concat(p)),w()(k()(n),"state",{showCode:!1}),w()(k()(n),"toggle",(function(){n.setState({showCode:!n.state.showCode})})),n}return r()(s,[{key:"render",value:function(){var n=this.state.showCode,a=this.props,s=a.title,t=a.src,p=a.children;return E.a.createElement("div",{className:"zandoc-react-demo"},E.a.createElement("div",{className:"zandoc-react-demo__preview"},p),E.a.createElement("div",{className:"zandoc-react-demo__bottom",onClick:this.toggle},E.a.createElement("div",{className:"zandoc-react-demo__title"},E.a.createElement("p",null,s||"")),E.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&&E.a.createElement("pre",{className:"zandoc-react-demo__code"},E.a.createElement(K,{tag:"code",html:t,attributes:{className:"language-jsx"}})))}}]),s}(v.Component),A=function(n){m()(s,n);var a=j(s);function s(){return l()(this,s),a.apply(this,arguments)}return r()(s,[{key:"componentDidMount",value:function(){var n=location.hash;if(n){var a=document.querySelector('a[href="'.concat(n,'"]'));a&&Object(D.a)(document.documentElement,0,function n(a,s){for(;a;)return a.offsetTop&&"static"!==getComputedStyle(a).position&&(s+=a.offsetTop),n(a.parentNode,s);return s}(a,-9))}}},{key:"render",value:function(){return E.a.createElement("div",{className:"zandoc-react-container",key:null},E.a.createElement(L,{style:""}),E.a.createElement(M,{html:'<h2 class="anchor-heading"><a href="#tree">¶</a><a href="javascript:void(0)" id="tree" class="anchor-point"></a>Tree</h2>\n<p>Tree widget is used to build and manipulate trees. such as files, organization structures, geographic infomation</p>\n<h3 class="anchor-heading"><a href="#guides">¶</a><a href="javascript:void(0)" id="guides" class="anchor-point"></a>Guides</h3>\n<ul>\n<li>Supports two types of data structure, nested tree and array.</li>\n<li>The widget only display input data, but not change itself.</li>\n</ul>\n<h3 class="anchor-heading"><a href="#demos">¶</a><a href="javascript:void(0)" id="demos" class="anchor-point"></a>Demos</h3>'}),E.a.createElement(q,{title:"Basic Usage",id:"Demobasic",src:'<span class="token keyword module">import</span> <span class="token punctuation">{</span> <span class="token maybe-class-name">Tree</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">const</span> treeData <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 number">1</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Hangzhou Youzan Technology Co. Ltd\'</span><span class="token punctuation">,</span>\n 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 number">2</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Engineer\'</span><span class="token punctuation">,</span>\n 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 number">3</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Back End Engineer\'</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token number">4</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Front End Engineer\'</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token number">5</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Operations Engineer\'</span>\n <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 id<span class="token operator">:</span> <span class="token number">6</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Product\'</span>\n <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\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">Tree</span></span> <span class="token attr-name">data</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>treeData<span class="token punctuation">}</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>'},E.a.createElement(I)),E.a.createElement(q,{title:"Array data",id:"Demoarraydata",src:'<span class="token keyword module">import</span> <span class="token punctuation">{</span> <span class="token maybe-class-name">Tree</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">const</span> treeData <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 number">1</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Hangzhou Youzan Technology Co. Ltd\'</span><span class="token punctuation">,</span>\n<span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token number">2</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Engineer\'</span><span class="token punctuation">,</span>\n parentId<span class="token operator">:</span> <span class="token number">1</span>\n<span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token number">3</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Back End Engineer\'</span><span class="token punctuation">,</span>\n parentId<span class="token operator">:</span> <span class="token number">2</span>\n<span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token number">4</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Front End Engineer\'</span><span class="token punctuation">,</span>\n parentId<span class="token operator">:</span> <span class="token number">2</span>\n<span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token number">5</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Operations Engineer\'</span><span class="token punctuation">,</span>\n parentId<span class="token operator">:</span> <span class="token number">2</span>\n<span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token number">6</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Product\'</span><span class="token punctuation">,</span>\n parentId<span class="token operator">:</span> <span class="token number">1</span>\n<span class="token punctuation">}</span><span class="token punctuation">]</span><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">Tree</span></span> <span class="token attr-name">dataType</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>plain<span class="token punctuation">"</span></span> <span class="token attr-name">data</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>treeData<span class="token punctuation">}</span></span> <span class="token punctuation">/></span></span>\n <span class="token punctuation">,</span> mountNode\n<span class="token punctuation">)</span>'},E.a.createElement(O)),E.a.createElement(q,{title:"Three Size",id:"Demosize",src:'<span class="token keyword module">import</span> <span class="token punctuation">{</span> <span class="token maybe-class-name">Tree</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">const</span> treeData <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 number">1</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Hangzhou Youzan Technology Co. Ltd\'</span><span class="token punctuation">,</span>\n 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 number">2</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Engineer\'</span><span class="token punctuation">,</span>\n 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 number">3</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Back End Engineer\'</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token number">4</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Front End Engineer\'</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token number">5</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Operations Engineer\'</span>\n <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 id<span class="token operator">:</span> <span class="token number">6</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Product\'</span>\n <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\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>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">Tree</span></span> <span class="token attr-name">data</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>treeData<span class="token punctuation">}</span></span> <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> <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">Tree</span></span> <span class="token attr-name">data</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>treeData<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">Tree</span></span> <span class="token attr-name">data</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>treeData<span class="token punctuation">}</span></span> <span class="token attr-name">size</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>large<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 punctuation">></span></span>\n <span class="token punctuation">,</span> mountNode\n<span class="token punctuation">)</span><span class="token punctuation">;</span>'},E.a.createElement(R)),E.a.createElement(q,{title:"Custom Node Display",id:"Democustomnode",src:'<span class="token keyword module">import</span> <span class="token punctuation">{</span> <span class="token maybe-class-name">Tree</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">const</span> treeData <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 number">1</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Hangzhou Youzan Technology Co. Ltd\'</span><span class="token punctuation">,</span>\n content<span class="token operator">:</span> <span class="token string">\'great company\'</span><span class="token punctuation">,</span>\n 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 number">2</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Engineer\'</span><span class="token punctuation">,</span>\n content<span class="token operator">:</span> <span class="token string">\'job http://job.youzan.com\'</span><span class="token punctuation">,</span>\n 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 number">3</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Back End Engineer\'</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token number">4</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Front End Engineer\'</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token number">5</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Operations Engineer\'</span>\n <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 id<span class="token operator">:</span> <span class="token number">6</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Product\'</span><span class="token punctuation">,</span>\n content<span class="token operator">:</span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>a</span> <span class="token attr-name">href</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>http://job.youzan.com<span class="token punctuation">"</span></span><span class="token punctuation">></span></span><span class="token string">\'send resume to [email protected]\'</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>\n <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\n<span class="token keyword">const</span> <span class="token function-variable function">customRender</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 tag"><span class="token tag"><span class="token punctuation"><</span>span</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> fontSize<span class="token operator">:</span> <span class="token number">16</span><span class="token punctuation">,</span> margin<span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span> lineHeight<span class="token operator">:</span> <span class="token number">1</span> <span class="token punctuation">}</span><span class="token punctuation">}</span></span><span class="token punctuation">></span></span>\n <span class="token punctuation">{</span>data<span class="token punctuation">.</span><span class="token property-access">title</span><span class="token punctuation">}</span>\n <span class="token punctuation">{</span>data<span class="token punctuation">.</span><span class="token property-access">content</span> <span class="token operator">?</span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>small</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> display<span class="token operator">:</span> <span class="token string">\'block\'</span><span class="token punctuation">,</span> fontSize<span class="token operator">:</span> <span class="token number">10</span> <span class="token punctuation">}</span><span class="token punctuation">}</span></span><span class="token punctuation">></span></span><span class="token punctuation">{</span>data<span class="token punctuation">.</span><span class="token property-access">content</span><span class="token punctuation">}</span><span class="token tag"><span class="token tag"><span class="token punctuation"></</span>small</span><span class="token punctuation">></span></span> <span class="token operator">:</span> <span class="token string">\'\'</span><span class="token punctuation">}</span>\n <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 punctuation">)</span><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">Tree</span></span> <span class="token attr-name">data</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>treeData<span class="token punctuation">}</span></span> <span class="token attr-name">render</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>customRender<span class="token punctuation">}</span></span> <span class="token punctuation">/></span></span>\n <span class="token punctuation">,</span> mountNode\n<span class="token punctuation">)</span>'},E.a.createElement(S)),E.a.createElement(q,{title:"Custom Operate",id:"Democustomoperate",src:'<span class="token keyword module">import</span> <span class="token punctuation">{</span> <span class="token maybe-class-name">Tree</span><span class="token punctuation">,</span> <span class="token maybe-class-name">Icon</span><span class="token punctuation">,</span> <span class="token maybe-class-name">Radio</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">const</span> <span class="token maybe-class-name">RadioGroup</span> <span class="token operator">=</span> <span class="token maybe-class-name">Radio</span><span class="token punctuation">.</span><span class="token property-access"><span class="token maybe-class-name">Group</span></span><span class="token punctuation">;</span>\n<span class="token keyword">const</span> originData <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 number">1</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Hangzhou Youzan Technology Co. Ltd\'</span><span class="token punctuation">,</span>\n<span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token number">2</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Engineer\'</span><span class="token punctuation">,</span>\n parentId<span class="token operator">:</span> <span class="token number">1</span>\n<span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token number">3</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Back End Engineer\'</span><span class="token punctuation">,</span>\n parentId<span class="token operator">:</span> <span class="token number">2</span>\n<span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token number">4</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Front End Engineer\'</span><span class="token punctuation">,</span>\n parentId<span class="token operator">:</span> <span class="token number">2</span>\n<span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token number">5</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Operations Engineer\'</span><span class="token punctuation">,</span>\n parentId<span class="token operator">:</span> <span class="token number">2</span>\n<span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token number">6</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Product\'</span><span class="token punctuation">,</span>\n parentId<span class="token operator">:</span> <span class="token number">1</span>\n<span class="token punctuation">}</span><span class="token punctuation">]</span><span class="token punctuation">;</span>\n\n<span class="token keyword">const</span> <span class="token function-variable function">deepClone</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token parameter">node<span class="token punctuation">,</span> parentId <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">,</span> nodeArray <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">]</span></span><span class="token punctuation">)</span> <span class="token arrow operator">=></span> <span class="token punctuation">{</span>\n <span class="token keyword">const</span> copyNode <span class="token operator">=</span> <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token known-class-name class-name">String</span><span class="token punctuation">(</span><span class="token known-class-name class-name">Math</span><span class="token punctuation">.</span><span class="token method function property-access">random</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">.</span><span class="token method function property-access">replace</span><span class="token punctuation">(</span><span class="token string">\'0.\'</span><span class="token punctuation">,</span> <span class="token string">\'\'</span><span class="token punctuation">)</span><span class="token punctuation">,</span>\n parentId<span class="token punctuation">,</span>\n title<span class="token operator">:</span> node<span class="token punctuation">.</span><span class="token property-access">title</span>\n <span class="token punctuation">}</span><span class="token punctuation">;</span>\n nodeArray<span class="token punctuation">.</span><span class="token method function property-access">push</span><span class="token punctuation">(</span>copyNode<span class="token punctuation">)</span><span class="token punctuation">;</span>\n\n <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">let</span> i <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">,</span> l <span class="token operator">=</span> node<span class="token punctuation">.</span><span class="token property-access">children</span> <span class="token operator">&&</span> node<span class="token punctuation">.</span><span class="token property-access">children</span><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 punctuation">;</span> i <span class="token operator"><</span> l<span class="token punctuation">;</span> i<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n <span class="token function">deepClone</span><span class="token punctuation">(</span>node<span class="token punctuation">.</span><span class="token property-access">children</span><span class="token punctuation">[</span>i<span class="token punctuation">]</span><span class="token punctuation">,</span> copyNode<span class="token punctuation">.</span><span class="token property-access">id</span><span class="token punctuation">,</span> nodeArray<span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span>\n <span class="token keyword">return</span> nodeArray<span class="token punctuation">;</span>\n<span class="token punctuation">}</span>\n\n<span class="token keyword">class</span> <span class="token class-name">TreeExample</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 treeData<span class="token operator">:</span> originData<span class="token punctuation">,</span>\n copyType<span class="token operator">:</span> <span class="token string">\'shallow\'</span>\n <span class="token punctuation">}</span>\n\n <span class="token function-variable function">onDelete</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 treeData<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><span class="token property-access">treeData</span><span class="token punctuation">.</span><span class="token method function property-access">filter</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 operator">!==</span> data<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><span class="token punctuation">;</span>\n\n <span class="token function-variable function">onClone</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">const</span> <span class="token punctuation">{</span> copyType <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">if</span> <span class="token punctuation">(</span>copyType <span class="token operator">===</span> <span class="token string">\'shallow\'</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n <span class="token keyword">const</span> node <span class="token operator">=</span> <span class="token known-class-name class-name">Object</span><span class="token punctuation">.</span><span class="token method function property-access">assign</span><span class="token punctuation">(</span><span class="token punctuation">{</span><span class="token punctuation">}</span><span class="token punctuation">,</span> data<span class="token punctuation">,</span> <span class="token punctuation">{</span> id<span class="token operator">:</span> <span class="token known-class-name class-name">Date</span><span class="token punctuation">.</span><span class="token method function property-access">now</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <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 treeData<span class="token operator">:</span> <span class="token punctuation">[</span><span class="token spread 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><span class="token property-access">treeData</span><span class="token punctuation">,</span> node<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 keyword">else</span> <span class="token keyword">if</span> <span class="token punctuation">(</span>copyType <span class="token operator">===</span> <span class="token string">\'deep\'</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n <span class="token keyword">const</span> nodeArray <span class="token operator">=</span> <span class="token function">deepClone</span><span class="token punctuation">(</span>data<span class="token punctuation">,</span> data<span class="token punctuation">.</span><span class="token property-access">parentId</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 treeData<span class="token operator">:</span> <span class="token punctuation">[</span><span class="token spread 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><span class="token property-access">treeData</span><span class="token punctuation">,</span> <span class="token spread operator">...</span>nodeArray<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 <span class="token punctuation">}</span><span class="token punctuation">;</span>\n\n <span class="token function-variable function">onCopyTypeChange</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token parameter">e</span><span class="token punctuation">)</span> <span class="token arrow operator">=></span> <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> copyType<span class="token operator">:</span> e<span class="token punctuation">.</span><span class="token property-access">target</span><span class="token punctuation">.</span><span class="token property-access">value</span> <span class="token punctuation">}</span><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> copyType<span class="token punctuation">,</span> treeData <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> operations <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">{</span>\n name<span class="token operator">:</span> <span class="token string">\'Delete\'</span><span class="token punctuation">,</span>\n icon<span class="token operator">:</span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Icon</span></span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>close<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span><span class="token punctuation">,</span>\n action<span class="token operator">:</span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token property-access">onDelete</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>\n name<span class="token operator">:</span> <span class="token string">\'Clone\'</span><span class="token punctuation">,</span>\n icon<span class="token operator">:</span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Icon</span></span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>plus<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span><span class="token punctuation">,</span>\n action<span class="token operator">:</span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token property-access">onClone</span>\n <span class="token punctuation">}</span><span class="token punctuation">]</span><span class="token punctuation">;</span>\n\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">RadioGroup</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 property-access">onCopyTypeChange</span><span class="token punctuation">}</span></span> <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>copyType<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">Radio</span></span> <span class="token attr-name">value</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>shallow<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>浅拷贝<span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Radio</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">Radio</span></span> <span class="token attr-name">value</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>deep<span class="token punctuation">"</span></span><span class="token punctuation">></span></span>深拷贝<span class="token tag"><span class="token tag"><span class="token punctuation"></</span><span class="token class-name">Radio</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">RadioGroup</span></span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>hr</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">Tree</span></span> <span class="token attr-name">data</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>treeData<span class="token punctuation">}</span></span> <span class="token attr-name">dataType</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>plain<span class="token punctuation">"</span></span> <span class="token attr-name">operations</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>operations<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 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">TreeExample</span></span> <span class="token punctuation">/></span></span>\n <span class="token punctuation">,</span> mountNode\n<span class="token punctuation">)</span>'},E.a.createElement(P)),E.a.createElement(q,{title:"Optional Tree",id:"Demooption",src:'<span class="token keyword module">import</span> <span class="token punctuation">{</span> <span class="token maybe-class-name">Tree</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">const</span> treeData <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 number">1</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Hangzhou Youzan Technology Co. Ltd\'</span><span class="token punctuation">,</span>\n 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 number">2</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Engineer\'</span><span class="token punctuation">,</span>\n 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 number">3</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Back End Engineer\'</span><span class="token punctuation">,</span>\n 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 number">7</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'JAVA\'</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token number">8</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'PHP\'</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token number">9</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'GO\'</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token number">10</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'.NET\'</span>\n <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 id<span class="token operator">:</span> <span class="token number">4</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Front End Engineer\'</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token number">5</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Operations Engineer\'</span>\n <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 id<span class="token operator">:</span> <span class="token number">6</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'Product\'</span>\n <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\n<span class="token keyword">class</span> <span class="token class-name">TreeExample</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 checkedKeys<span class="token operator">:</span> <span class="token punctuation">[</span><span class="token number">3</span><span class="token punctuation">,</span> <span class="token number">5</span><span class="token punctuation">,</span> <span class="token number">22</span><span class="token punctuation">]</span><span class="token punctuation">,</span>\n disabledCheckedKeys<span class="token operator">:</span> <span class="token punctuation">[</span><span class="token number">4</span><span class="token punctuation">,</span> <span class="token number">7</span><span class="token punctuation">,</span> <span class="token number">9</span><span class="token punctuation">,</span> <span class="token number">22</span><span class="token punctuation">]</span>\n <span class="token punctuation">}</span>\n\n <span class="token function-variable function">onCheck</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token parameter">checked<span class="token punctuation">,</span> helpInfo</span><span class="token punctuation">)</span> <span class="token arrow operator">=></span> <span class="token punctuation">{</span>\n <span class="token console class-name">console</span><span class="token punctuation">.</span><span class="token method function property-access">log</span><span class="token punctuation">(</span>checked<span class="token punctuation">,</span> helpInfo<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 checkedKeys<span class="token operator">:</span> checked\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> checkedKeys<span class="token punctuation">,</span> disabledCheckedKeys <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">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">Tree</span></span>\n <span class="token attr-name">checkable</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">data</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>treeData<span class="token punctuation">}</span></span>\n <span class="token attr-name">onCheck</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">onCheck</span><span class="token punctuation">}</span></span>\n <span class="token attr-name">checkedKeys</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>checkedKeys<span class="token punctuation">}</span></span>\n <span class="token attr-name">disabledCheckedKeys</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>disabledCheckedKeys<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">TreeExample</span></span> <span class="token punctuation">/></span></span>\n <span class="token punctuation">,</span> mountNode\n<span class="token punctuation">)</span>'},E.a.createElement(N)),E.a.createElement(q,{title:"Async Loading",id:"Demoasync",src:'<span class="token keyword module">import</span> <span class="token punctuation">{</span> <span class="token maybe-class-name">Tree</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">const</span> <span class="token function-variable function">fetchData</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token parameter">data<span class="token punctuation">,</span> callback</span><span class="token punctuation">)</span> <span class="token arrow operator">=></span> <span class="token punctuation">{</span>\n <span class="token keyword">if</span> <span class="token punctuation">(</span>data<span class="token punctuation">.</span><span class="token property-access">level</span> <span class="token operator"><</span> <span class="token number">4</span><span class="token punctuation">)</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">const</span> resData <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">;</span>\n <span class="token keyword">const</span> base <span class="token operator">=</span> <span class="token known-class-name class-name">Number</span><span class="token punctuation">(</span>data<span class="token punctuation">.</span><span class="token property-access">title</span><span class="token punctuation">.</span><span class="token method function property-access">split</span><span class="token punctuation">(</span><span class="token string">\'-\'</span><span class="token punctuation">)</span><span class="token punctuation">[</span><span class="token number">0</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token keyword">const</span> step <span class="token operator">=</span> <span class="token known-class-name class-name">Math</span><span class="token punctuation">.</span><span class="token method function property-access">pow</span><span class="token punctuation">(</span><span class="token number">10</span><span class="token punctuation">,</span> <span class="token number">3</span> <span class="token operator">-</span> data<span class="token punctuation">.</span><span class="token property-access">level</span><span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token keyword">const</span> level <span class="token operator">=</span> data<span class="token punctuation">.</span><span class="token property-access">level</span> <span class="token operator">+</span> <span class="token number">1</span><span class="token punctuation">;</span>\n <span class="token keyword">for</span> <span class="token punctuation">(</span><span class="token keyword">let</span> i <span class="token operator">=</span> <span class="token number">0</span><span class="token punctuation">,</span> id <span class="token operator">=</span> <span class="token string">\'\'</span><span class="token punctuation">,</span> isLeaf <span class="token operator">=</span> <span class="token boolean">false</span><span class="token punctuation">;</span> i <span class="token operator"><=</span> <span class="token number">9</span><span class="token punctuation">;</span> i<span class="token operator">++</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n <span class="token keyword">if</span> <span class="token punctuation">(</span>level <span class="token operator">===</span> <span class="token number">4</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n id <span class="token operator">=</span> <span class="token known-class-name class-name">String</span><span class="token punctuation">(</span>base <span class="token operator">+</span> i<span class="token punctuation">)</span><span class="token punctuation">;</span>\n isLeaf <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 keyword">else</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 interpolation"><span class="token interpolation-punctuation punctuation">${</span>base <span class="token operator">+</span> step <span class="token operator">*</span> i<span class="token interpolation-punctuation punctuation">}</span></span><span class="token string">-</span><span class="token interpolation"><span class="token interpolation-punctuation punctuation">${</span>base <span class="token operator">+</span> step <span class="token operator">*</span> <span class="token punctuation">(</span>i <span class="token operator">+</span> <span class="token number">1</span><span class="token punctuation">)</span><span class="token interpolation-punctuation punctuation">}</span></span><span class="token template-punctuation string">`</span></span><span class="token punctuation">;</span>\n isLeaf <span class="token operator">=</span> <span class="token boolean">false</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span>\n resData<span class="token punctuation">.</span><span class="token method function property-access">push</span><span class="token punctuation">(</span><span class="token punctuation">{</span> id<span class="token punctuation">,</span> level<span class="token punctuation">,</span> title<span class="token operator">:</span> id<span class="token punctuation">,</span> isLeaf <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span>\n <span class="token function">callback</span><span class="token punctuation">(</span>resData<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">200</span><span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span> <span class="token keyword">else</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 function">callback</span><span class="token punctuation">(</span><span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">)</span><span class="token punctuation">,</span> <span class="token number">200</span><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 keyword">class</span> <span class="token class-name">TreeExample</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 treeData<span class="token operator">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span>\n <span class="token punctuation">}</span>\n\n <span class="token function">componentDidMount</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n <span class="token keyword">const</span> rootData <span class="token operator">=</span> <span class="token punctuation">{</span>\n id<span class="token operator">:</span> <span class="token string">\'1-0-10000\'</span><span class="token punctuation">,</span>\n title<span class="token operator">:</span> <span class="token string">\'0-10000\'</span><span class="token punctuation">,</span>\n level<span class="token operator">:</span> <span class="token number">0</span><span class="token punctuation">,</span>\n expand<span class="token operator">:</span> <span class="token boolean">true</span>\n <span class="token punctuation">}</span><span class="token punctuation">;</span>\n <span class="token function">fetchData</span><span class="token punctuation">(</span>rootData<span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token parameter">resData</span><span class="token punctuation">)</span> <span class="token arrow operator">=></span> <span class="token punctuation">{</span>\n <span class="token keyword">const</span> newData <span class="token operator">=</span> resData<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> <span class="token punctuation">(</span><span class="token punctuation">{</span>\n <span class="token spread operator">...</span>item<span class="token punctuation">,</span>\n parentId<span class="token operator">:</span> rootData<span class="token punctuation">.</span><span class="token property-access">id</span>\n <span class="token punctuation">}</span><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 treeData<span class="token operator">:</span> <span class="token punctuation">[</span>rootData<span class="token punctuation">,</span> <span class="token spread operator">...</span>newData<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><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">data</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">fetchData</span><span class="token punctuation">(</span>data<span class="token punctuation">,</span> <span class="token punctuation">(</span><span class="token parameter">resData</span><span class="token punctuation">)</span> <span class="token arrow operator">=></span> <span class="token punctuation">{</span>\n <span class="token keyword">const</span> newData <span class="token operator">=</span> resData<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> <span class="token punctuation">(</span><span class="token punctuation">{</span>\n <span class="token spread operator">...</span>item<span class="token punctuation">,</span>\n parentId<span class="token operator">:</span> data<span class="token punctuation">.</span><span class="token property-access">id</span>\n <span class="token punctuation">}</span><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> treeData<span class="token operator">:</span> <span class="token punctuation">[</span><span class="token spread 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><span class="token property-access">treeData</span><span class="token punctuation">,</span> <span class="token spread operator">...</span>newData<span class="token punctuation">]</span> <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><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 punctuation">}</span><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> treeData <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">return</span> <span class="token tag"><span class="token tag"><span class="token punctuation"><</span><span class="token class-name">Tree</span></span> <span class="token attr-name">dataType</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>plain<span class="token punctuation">"</span></span> <span class="token attr-name">data</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>treeData<span class="token punctuation">}</span></span> <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> <span class="token punctuation">/></span></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">TreeExample</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>'},E.a.createElement(x)),E.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<h4 class="anchor-heading"><a href="#tree">¶</a><a href="javascript:void(0)" id="tree" class="anchor-point"></a>Tree</h4>\n<table class="table">\n<thead>\n<tr>\n<th>Property</th>\n<th>Description</th>\n<th>Type</th>\n<th>Default</th>\n<th>Alternative</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>dataType</td>\n<td>data structure, default is tree</td>\n<td>string</td>\n<td><code>\'tree\'</code></td>\n<td><code>\'plain\'</code></td>\n</tr>\n<tr>\n<td>data</td>\n<td>required, input data, identified by dataType</td>\n<td>array</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>renderKey</td>\n<td>the key map for render node, see the following table</td>\n<td>object</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>render</td>\n<td>you can customize function to render tree , the parameter is node data (includings children tree)</td>\n<td>func(data)</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>operations</td>\n<td>custom operate, includes \n<code>name</code>\n, \n<code>icon</code>\n, \n<code>action</code>\n, \n<code>shouldRender</code>\n attributes</td>\n<td>array\n[\nobject\n]</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>foldable</td>\n<td>whether to support item show and hide</td>\n<td>bool</td>\n<td><code>true</code></td>\n<td></td>\n</tr>\n<tr>\n<td>onCheck</td>\n<td>when you click checkbox, callback function will call, params is a checked id list and help info</td>\n<td>func(ids, helpInfo)</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>checkable</td>\n<td>whether to support checkbox</td>\n<td>bool</td>\n<td><code>true</code></td>\n<td></td>\n</tr>\n<tr>\n<td>checkedKeys</td>\n<td>checked node id array</td>\n<td>array</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>disabledCheckedKeys</td>\n<td>default disabled selected node id array</td>\n<td>array</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>size</td>\n<td>size</td>\n<td>string</td>\n<td><code>\'medium\'</code></td>\n<td><code>\'small\'</code>\n, \n<code>\'large\'</code></td>\n</tr>\n<tr>\n<td>commonStyle</td>\n<td>set entire tree style</td>\n<td>object</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>expandAll</td>\n<td>whether to expand all nodes</td>\n<td>bool</td>\n<td><code>false</code></td>\n<td></td>\n</tr>\n<tr>\n<td>onExpand</td>\n<td>after node expands, callback is trigger</td>\n<td>func(data, config)</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>autoExpandOnSelect</td>\n<td>node auto expands when you select it</td>\n<td>bool</td>\n<td><code>true</code></td>\n<td></td>\n</tr>\n<tr>\n<td>onSelect</td>\n<td>the callback when you choose tree node</td>\n<td>func(data, target)</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>isRoot</td>\n<td>plain data, to determine whether the node is the api of the root node</td>\n<td>func(node)</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>loadMore</td>\n<td>return Promise func, support thenable callback, be used to asynchronously load more content</td>\n<td>func(data)</td>\n<td></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<h4 class="anchor-heading"><a href="#renderkey">¶</a><a href="javascript:void(0)" id="renderkey" class="anchor-point"></a>renderKey</h4>\n<p>The Key for customized for <code>data</code>.</p>\n<table class="table">\n<thead>\n<tr>\n<th>Property</th>\n<th>Description</th>\n<th>Type</th>\n<th>Default</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>id</td>\n<td>key for unique key</td>\n<td>string</td>\n<td><code>\'id\'</code></td>\n</tr>\n<tr>\n<td>title</td>\n<td>key for show title</td>\n<td>string</td>\n<td><code>\'title\'</code></td>\n</tr>\n<tr>\n<td>children</td>\n<td>key for children tree (\n<code>dataType="tree"</code>\n it works)</td>\n<td>string</td>\n<td><code>\'children\'</code></td>\n</tr>\n<tr>\n<td>parentId</td>\n<td>key for parent Id (\n<code>dataType="plain"</code>\n it works)</td>\n<td>string</td>\n<td><code>\'parentId\'</code></td>\n</tr>\n</tbody>\n</table>\n<h4 class="anchor-heading"><a href="#data">¶</a><a href="javascript:void(0)" id="data" class="anchor-point"></a>data</h4>\n<p>Except for key-value below, you can add attributes on any node, the callback will get entire data that user input.\nYou can customize key through <code>renderKey</code>.</p>\n<table class="table">\n<thead>\n<tr>\n<th>Property</th>\n<th>Description</th>\n<th>Type</th>\n<th>Default</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>id</td>\n<td>required, unique key</td>\n<td>number/string</td>\n<td></td>\n</tr>\n<tr>\n<td>title</td>\n<td>required, show title</td>\n<td>string</td>\n<td></td>\n</tr>\n<tr>\n<td>children</td>\n<td>children tree (\n<code>dataType="tree"</code>\n it works)</td>\n<td>array\n[\nobject\n]</td>\n<td></td>\n</tr>\n<tr>\n<td>parentId</td>\n<td>parent Id (\n<code>dataType="plain"</code>\n it works), root node is 0 or undefined</td>\n<td>number/string</td>\n<td></td>\n</tr>\n<tr>\n<td>expand</td>\n<td>whether to expand or not</td>\n<td>bool</td>\n<td><code>false</code></td>\n</tr>\n<tr>\n<td>isLeaf</td>\n<td>whether is leaf node or not</td>\n<td>bool</td>\n<td><code>false</code></td>\n</tr>\n</tbody>\n</table>\n<h4 class="anchor-heading"><a href="#operations">¶</a><a href="javascript:void(0)" id="operations" class="anchor-point"></a>operations</h4>\n<table class="table">\n<thead>\n<tr>\n<th>Property</th>\n<th>Description</th>\n<th>Type</th>\n<th>Default</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>name</td>\n<td>required, show content</td>\n<td>string</td>\n<td></td>\n</tr>\n<tr>\n<td>icon</td>\n<td>display icon className, or ReactNode</td>\n<td>string/ReactNode</td>\n<td></td>\n</tr>\n<tr>\n<td>action</td>\n<td>required, click callback, the parameter is children tree</td>\n<td>func(data)</td>\n<td></td>\n</tr>\n<tr>\n<td>shouldRender</td>\n<td>is it need to update, return true/false</td>\n<td>func(data)</td>\n<td><code>true</code></td>\n</tr>\n</tbody>\n</table>'}))}}]),s}(v.Component)}}]);