-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path121-bc4eac5649ec72ccd951.js
1 lines (1 loc) · 36.4 KB
/
121-bc4eac5649ec72ccd951.js
1
(window.webpackJsonp=window.webpackJsonp||[]).push([[121],{642:function(n,a,s){"use strict";s.r(a),s.d(a,"default",function(){return z});var t=s(580),p=s.n(t),o=s(23),e=s.n(o),c=s(24),l=s.n(c),u=s(25),i=s.n(u),k=s(26),r=s.n(k),d=s(32),g=s.n(d),m=s(27),h=s.n(m),v=s(28),w=s.n(v),y=s(0),f=s.n(y),S=s(111),b=s(82),C=function(){var n=[{value:1,text:"red"},{value:2,text:"blue"},{value:3,text:"green"}],a=function(a){function s(){var n,a;e()(this,s);for(var t=arguments.length,p=new Array(t),o=0;o<t;o++)p[o]=arguments[o];return a=i()(this,(n=r()(s)).call.apply(n,[this].concat(p))),w()(g()(a),"handleSelect",function(n){b.db.success(n)}),w()(g()(a),"handleClick",function(){b.db.success("666")}),a}return h()(s,a),l()(s,[{key:"render",value:function(){return f.a.createElement("div",null,f.a.createElement(b.tb,{dropdownData:n,onClick:this.handleClick,onSelect:this.handleSelect},"普通"),f.a.createElement(b.tb,{type:"primary",dropdownData:n,onClick:this.handleClick,onSelect:this.handleSelect},"按钮"),f.a.createElement(b.tb,{disabled:!0,type:"primary",dropdownData:n,onClick:this.handleClick,onSelect:this.handleSelect},"禁用"),f.a.createElement(b.tb,{loading:!0,type:"primary",dropdownData:n,onClick:this.handleClick,onSelect:this.handleSelect},"加载中"),f.a.createElement(b.tb,{type:"danger",size:"large",dropdownData:n},"大号"),f.a.createElement(b.tb,{type:"success",size:"small",dropdownData:n},"小号"))}}]),s}(f.a.Component);return f.a.createElement(a,null)},E=function(){var n=[{id:1,value:"red"},{id:2,value:"green"},{id:3,value:"blue"}],a=function(a){function s(){var n,a;e()(this,s);for(var t=arguments.length,p=new Array(t),o=0;o<t;o++)p[o]=arguments[o];return a=i()(this,(n=r()(s)).call.apply(n,[this].concat(p))),w()(g()(a),"handleSelect",function(n){b.db.success(n)}),w()(g()(a),"handleClick",function(){b.db.success("666")}),a}return h()(s,a),l()(s,[{key:"render",value:function(){return f.a.createElement("div",null,f.a.createElement(b.tb,{type:"primary",dropdownData:n,dropdownTrigger:"hover",dropdownValue:"id",dropdownText:"value",onClick:this.handleClick,onSelect:this.handleSelect},"按钮"),f.a.createElement(b.tb,{type:"danger",disabled:!0,dropdownData:n,dropdownTrigger:"hover",dropdownValue:"id",dropdownText:"value",onClick:this.handleClick,onSelect:this.handleSelect},"禁用"))}}]),s}(f.a.Component);return f.a.createElement(a,null)},j=function(){var n=[{id:1,value:"red"},{id:2,value:"green"},{id:3,value:"blue"}],a=function(a){function s(){var n,a;e()(this,s);for(var t=arguments.length,p=new Array(t),o=0;o<t;o++)p[o]=arguments[o];return a=i()(this,(n=r()(s)).call.apply(n,[this].concat(p))),w()(g()(a),"handleSelect",function(n){b.db.success(n)}),w()(g()(a),"handleClick",function(){b.db.success("666")}),a}return h()(s,a),l()(s,[{key:"render",value:function(){return f.a.createElement("div",null,f.a.createElement(b.tb,{type:"primary",dropdownData:n,dropdownTrigger:"hover",dropdownValue:"id",dropdownText:"value",dropdownPosition:"top-left",onClick:this.handleClick,onSelect:this.handleSelect},"上面"),f.a.createElement(b.tb,{type:"danger",dropdownData:n,dropdownValue:"id",dropdownText:"value",dropdownPosition:"bottom-right",onClick:this.handleClick,onSelect:this.handleSelect},"下面"))}}]),s}(f.a.Component);return f.a.createElement(a,null)};function D(n){return f.a.createElement(n.tag,p()({},n.attributes,{dangerouslySetInnerHTML:{__html:n.html}}))}function B(n){return f.a.createElement(D,{tag:"section",html:n.html,attributes:{className:"zandoc-react-markdown"}})}function x(n){return f.a.createElement(D,{tag:"style",html:n.style})}var N=function(n){function a(){var n,s;e()(this,a);for(var t=arguments.length,p=new Array(t),o=0;o<t;o++)p[o]=arguments[o];return s=i()(this,(n=r()(a)).call.apply(n,[this].concat(p))),w()(g()(s),"state",{showCode:!1}),w()(g()(s),"toggle",function(){s.setState({showCode:!s.state.showCode})}),s}return h()(a,n),l()(a,[{key:"render",value:function(){var n=this.state.showCode,a=this.props,s=a.title,t=a.src,p=a.children;return f.a.createElement("div",{className:"zandoc-react-demo"},f.a.createElement("div",{className:"zandoc-react-demo__preview"},p),f.a.createElement("div",{className:"zandoc-react-demo__bottom",onClick:this.toggle},f.a.createElement("div",{className:"zandoc-react-demo__title"},f.a.createElement("p",null,s||"")),f.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&&f.a.createElement("pre",{className:"zandoc-react-demo__code"},f.a.createElement(D,{tag:"code",html:t,attributes:{className:"language-jsx"}})))}}]),a}(y.Component),z=function(n){function a(){return e()(this,a),i()(this,r()(a).apply(this,arguments))}return h()(a,n),l()(a,[{key:"componentDidMount",value:function(){var n=location.hash;if(n){var a=document.querySelector('a[href="'.concat(n,'"]'));a&&Object(S.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 f.a.createElement("div",{className:"zandoc-react-container",key:null},f.a.createElement(x,{style:""}),f.a.createElement(B,{html:'<h2 class="anchor-heading"><a href="#splitbutton-xia-la-an-niu">¶</a><a href="javascript:void(0)" id="splitbutton-xia-la-an-niu" class="anchor-point"></a>SplitButton 下拉按钮</h2>\n<p>SplitButton 带有下拉菜单功能的按钮</p>\n<h3 class="anchor-heading"><a href="#dai-ma-yan-shi">¶</a><a href="javascript:void(0)" id="dai-ma-yan-shi" class="anchor-point"></a>代码演示</h3>'}),f.a.createElement(N,{title:"基础用法",id:"Demobasic",src:'<span class="token keyword">const</span> list <span class="token operator">=</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n value<span class="token punctuation">:</span> <span class="token number">1</span><span class="token punctuation">,</span>\n text<span class="token punctuation">:</span> <span class="token string">\'red\'</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n value<span class="token punctuation">:</span> <span class="token number">2</span><span class="token punctuation">,</span>\n text<span class="token punctuation">:</span> <span class="token string">\'blue\'</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n value<span class="token punctuation">:</span> <span class="token number">3</span><span class="token punctuation">,</span>\n text<span class="token punctuation">:</span> <span class="token string">\'green\'</span>\n <span class="token punctuation">}</span>\n<span class="token punctuation">]</span>\n\n<span class="token keyword">import</span> <span class="token punctuation">{</span> SplitButton<span class="token punctuation">,</span> Notify <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">\'zent\'</span><span class="token punctuation">;</span>\n\n<span class="token keyword">class</span> <span class="token class-name">Simple</span> <span class="token keyword">extends</span> <span class="token class-name">React<span class="token punctuation">.</span>Component</span> <span class="token punctuation">{</span>\n <span class="token function-variable function">handleSelect</span> <span class="token operator">=</span> <span class="token punctuation">(</span>value<span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token punctuation">{</span>\n Notify<span class="token punctuation">.</span><span class="token function">success</span><span class="token punctuation">(</span>value<span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span>\n\n <span class="token function-variable function">handleClick</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token punctuation">{</span>\n Notify<span class="token punctuation">.</span><span class="token function">success</span><span class="token punctuation">(</span><span class="token string">\'666\'</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>SplitButton</span>\n <span class="token attr-name">dropdownData</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span>list<span class="token punctuation">}</span></span>\n <span class="token attr-name">onClick</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span>handleClick<span class="token punctuation">}</span></span>\n <span class="token attr-name">onSelect</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span>handleSelect<span class="token punctuation">}</span></span>\n <span class="token punctuation">></span></span>\n 普通\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>SplitButton</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>SplitButton</span>\n <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>primary<span class="token punctuation">"</span></span>\n <span class="token attr-name">dropdownData</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span>list<span class="token punctuation">}</span></span>\n <span class="token attr-name">onClick</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span>handleClick<span class="token punctuation">}</span></span>\n <span class="token attr-name">onSelect</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span>handleSelect<span class="token punctuation">}</span></span>\n <span class="token punctuation">></span></span>\n 按钮\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>SplitButton</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>SplitButton</span>\n <span class="token attr-name">disabled</span>\n <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>primary<span class="token punctuation">"</span></span>\n <span class="token attr-name">dropdownData</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span>list<span class="token punctuation">}</span></span>\n <span class="token attr-name">onClick</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span>handleClick<span class="token punctuation">}</span></span>\n <span class="token attr-name">onSelect</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span>handleSelect<span class="token punctuation">}</span></span>\n <span class="token punctuation">></span></span>\n 禁用\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>SplitButton</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>SplitButton</span>\n <span class="token attr-name">loading</span>\n <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>primary<span class="token punctuation">"</span></span>\n <span class="token attr-name">dropdownData</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span>list<span class="token punctuation">}</span></span>\n <span class="token attr-name">onClick</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span>handleClick<span class="token punctuation">}</span></span>\n <span class="token attr-name">onSelect</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span>handleSelect<span class="token punctuation">}</span></span>\n <span class="token punctuation">></span></span>\n 加载中\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>SplitButton</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>SplitButton</span>\n <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>danger<span class="token punctuation">"</span></span>\n <span class="token attr-name">size</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>large<span class="token punctuation">"</span></span>\n <span class="token attr-name">dropdownData</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span>list<span class="token punctuation">}</span></span>\n <span class="token punctuation">></span></span>\n 大号\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>SplitButton</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>SplitButton</span>\n <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>success<span class="token punctuation">"</span></span>\n <span class="token attr-name">size</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>small<span class="token punctuation">"</span></span>\n <span class="token attr-name">dropdownData</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span>list<span class="token punctuation">}</span></span>\n <span class="token punctuation">></span></span>\n 小号\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>SplitButton</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\nReactDOM<span class="token punctuation">.</span><span class="token function">render</span><span class="token punctuation">(</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>Simple</span> <span class="token punctuation">/></span></span>\n <span class="token punctuation">,</span> mountNode\n<span class="token punctuation">)</span><span class="token punctuation">;</span>'},f.a.createElement(C)),f.a.createElement(N,{title:"dropdown设置",id:"Demodropdown",src:'<span class="token keyword">const</span> list <span class="token operator">=</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n id<span class="token punctuation">:</span> <span class="token number">1</span><span class="token punctuation">,</span>\n value<span class="token punctuation">:</span> <span class="token string">\'red\'</span><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 punctuation">:</span> <span class="token number">2</span><span class="token punctuation">,</span>\n value<span class="token punctuation">:</span> <span class="token string">\'green\'</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n id<span class="token punctuation">:</span> <span class="token number">3</span><span class="token punctuation">,</span>\n value<span class="token punctuation">:</span> <span class="token string">\'blue\'</span>\n <span class="token punctuation">}</span>\n<span class="token punctuation">]</span>\n\n<span class="token keyword">import</span> <span class="token punctuation">{</span> SplitButton<span class="token punctuation">,</span> Notify <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">\'zent\'</span><span class="token punctuation">;</span>\n\n<span class="token keyword">class</span> <span class="token class-name">Simple</span> <span class="token keyword">extends</span> <span class="token class-name">React<span class="token punctuation">.</span>Component</span> <span class="token punctuation">{</span>\n <span class="token function-variable function">handleSelect</span> <span class="token operator">=</span> <span class="token punctuation">(</span>value<span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token punctuation">{</span>\n Notify<span class="token punctuation">.</span><span class="token function">success</span><span class="token punctuation">(</span>value<span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span>\n\n <span class="token function-variable function">handleClick</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token punctuation">{</span>\n Notify<span class="token punctuation">.</span><span class="token function">success</span><span class="token punctuation">(</span><span class="token string">\'666\'</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>SplitButton</span>\n <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>primary<span class="token punctuation">"</span></span>\n <span class="token attr-name">dropdownData</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span>list<span class="token punctuation">}</span></span>\n <span class="token attr-name">dropdownTrigger</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>hover<span class="token punctuation">"</span></span>\n <span class="token attr-name">dropdownValue</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>id<span class="token punctuation">"</span></span>\n <span class="token attr-name">dropdownText</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>value<span class="token punctuation">"</span></span>\n <span class="token attr-name">onClick</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span>handleClick<span class="token punctuation">}</span></span>\n <span class="token attr-name">onSelect</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span>handleSelect<span class="token punctuation">}</span></span>\n <span class="token punctuation">></span></span>\n 按钮\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>SplitButton</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>SplitButton</span>\n <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>danger<span class="token punctuation">"</span></span>\n <span class="token attr-name">disabled</span>\n <span class="token attr-name">dropdownData</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span>list<span class="token punctuation">}</span></span>\n <span class="token attr-name">dropdownTrigger</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>hover<span class="token punctuation">"</span></span>\n <span class="token attr-name">dropdownValue</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>id<span class="token punctuation">"</span></span>\n <span class="token attr-name">dropdownText</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>value<span class="token punctuation">"</span></span>\n <span class="token attr-name">onClick</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span>handleClick<span class="token punctuation">}</span></span>\n <span class="token attr-name">onSelect</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span>handleSelect<span class="token punctuation">}</span></span>\n <span class="token punctuation">></span></span>\n 禁用\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>SplitButton</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\nReactDOM<span class="token punctuation">.</span><span class="token function">render</span><span class="token punctuation">(</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>Simple</span> <span class="token punctuation">/></span></span>\n <span class="token punctuation">,</span> mountNode\n<span class="token punctuation">)</span><span class="token punctuation">;</span>'},f.a.createElement(E)),f.a.createElement(N,{title:"dropdown位置设置",id:"Demodropdownposition",src:'<span class="token keyword">const</span> list <span class="token operator">=</span> <span class="token punctuation">[</span>\n <span class="token punctuation">{</span>\n id<span class="token punctuation">:</span> <span class="token number">1</span><span class="token punctuation">,</span>\n value<span class="token punctuation">:</span> <span class="token string">\'red\'</span><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 punctuation">:</span> <span class="token number">2</span><span class="token punctuation">,</span>\n value<span class="token punctuation">:</span> <span class="token string">\'green\'</span>\n <span class="token punctuation">}</span><span class="token punctuation">,</span>\n <span class="token punctuation">{</span>\n id<span class="token punctuation">:</span> <span class="token number">3</span><span class="token punctuation">,</span>\n value<span class="token punctuation">:</span> <span class="token string">\'blue\'</span>\n <span class="token punctuation">}</span>\n<span class="token punctuation">]</span>\n\n<span class="token keyword">import</span> <span class="token punctuation">{</span> SplitButton<span class="token punctuation">,</span> Notify <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">\'zent\'</span><span class="token punctuation">;</span>\n\n<span class="token keyword">class</span> <span class="token class-name">Simple</span> <span class="token keyword">extends</span> <span class="token class-name">React<span class="token punctuation">.</span>Component</span> <span class="token punctuation">{</span>\n <span class="token function-variable function">handleSelect</span> <span class="token operator">=</span> <span class="token punctuation">(</span>value<span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token punctuation">{</span>\n Notify<span class="token punctuation">.</span><span class="token function">success</span><span class="token punctuation">(</span>value<span class="token punctuation">)</span><span class="token punctuation">;</span>\n <span class="token punctuation">}</span>\n\n <span class="token function-variable function">handleClick</span> <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=></span> <span class="token punctuation">{</span>\n Notify<span class="token punctuation">.</span><span class="token function">success</span><span class="token punctuation">(</span><span class="token string">\'666\'</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>SplitButton</span>\n <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>primary<span class="token punctuation">"</span></span>\n <span class="token attr-name">dropdownData</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span>list<span class="token punctuation">}</span></span>\n <span class="token attr-name">dropdownTrigger</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>hover<span class="token punctuation">"</span></span>\n <span class="token attr-name">dropdownValue</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>id<span class="token punctuation">"</span></span>\n <span class="token attr-name">dropdownText</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>value<span class="token punctuation">"</span></span>\n <span class="token attr-name">dropdownPosition</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>top-left<span class="token punctuation">"</span></span>\n <span class="token attr-name">onClick</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span>handleClick<span class="token punctuation">}</span></span>\n <span class="token attr-name">onSelect</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span>handleSelect<span class="token punctuation">}</span></span>\n <span class="token punctuation">></span></span>\n 上面\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>SplitButton</span><span class="token punctuation">></span></span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>SplitButton</span>\n <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>danger<span class="token punctuation">"</span></span>\n <span class="token attr-name">dropdownData</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span>list<span class="token punctuation">}</span></span>\n <span class="token attr-name">dropdownValue</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>id<span class="token punctuation">"</span></span>\n <span class="token attr-name">dropdownText</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>value<span class="token punctuation">"</span></span>\n <span class="token attr-name">dropdownPosition</span><span class="token attr-value"><span class="token punctuation">=</span><span class="token punctuation">"</span>bottom-right<span class="token punctuation">"</span></span>\n <span class="token attr-name">onClick</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span>handleClick<span class="token punctuation">}</span></span>\n <span class="token attr-name">onSelect</span><span class="token script language-javascript"><span class="token punctuation">=</span><span class="token punctuation">{</span><span class="token keyword">this</span><span class="token punctuation">.</span>handleSelect<span class="token punctuation">}</span></span>\n <span class="token punctuation">></span></span>\n 下面\n <span class="token tag"><span class="token tag"><span class="token punctuation"></</span>SplitButton</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\nReactDOM<span class="token punctuation">.</span><span class="token function">render</span><span class="token punctuation">(</span>\n <span class="token tag"><span class="token tag"><span class="token punctuation"><</span>Simple</span> <span class="token punctuation">/></span></span>\n <span class="token punctuation">,</span> mountNode\n<span class="token punctuation">)</span><span class="token punctuation">;</span>'},f.a.createElement(j)),f.a.createElement(B,{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>参数</th>\n<th>说明</th>\n<th>类型</th>\n<th>默认值</th>\n<th>备选值</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>type</td>\n<td>按钮风格</td>\n<td>string</td>\n<td><code>'default'</code></td>\n<td><code>'primary'</code>\n、\n<code>'danger'</code>\n、\n<code>'success'</code></td>\n</tr>\n<tr>\n<td>disabled</td>\n<td>按钮是否禁用</td>\n<td>bool</td>\n<td><code>false</code></td>\n<td><code>true</code>\n、\n<code>false</code></td>\n</tr>\n<tr>\n<td>loading</td>\n<td>是否显示loading图标</td>\n<td>bool</td>\n<td><code>false</code></td>\n<td><code>true</code>\n, \n<code>false</code></td>\n</tr>\n<tr>\n<td>size</td>\n<td>按钮尺寸</td>\n<td>string</td>\n<td><code>'medium'</code></td>\n<td><code>'large'</code>\n、\n<code>'medium'</code>\n、\n<code>'small'</code></td>\n</tr>\n<tr>\n<td>dropdownTrigger</td>\n<td>下拉菜单触发方式</td>\n<td>string</td>\n<td><code>'click'</code></td>\n<td><code>'click'</code>\n、\n<code>'hover'</code></td>\n</tr>\n<tr>\n<td>dropdownData</td>\n<td>下拉菜单数据</td>\n<td>array</td>\n<td>[]</td>\n<td></td>\n</tr>\n<tr>\n<td>dropdownValue</td>\n<td>自定义选项的值对应的key, 如{ id: 1, name: '文案' }, dropdownValue=\"id\"</td>\n<td>string</td>\n<td><code>'value'</code></td>\n<td></td>\n</tr>\n<tr>\n<td>dropdownText</td>\n<td>自定义选项显示文案对应的key, 如{ id: 1, name: '文案' }, dropdownText=\"name\"</td>\n<td>string</td>\n<td><code>'text'</code></td>\n<td></td>\n</tr>\n<tr>\n<td>dropdownPosition</td>\n<td>下拉菜单位置</td>\n<td>string</td>\n<td><code>'auto-bottom-left'</code></td>\n<td>同Pop中的position</td>\n</tr>\n<tr>\n<td>onClick</td>\n<td>左侧按钮点击时的回调函数</td>\n<td>func</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>onSelect</td>\n<td>右侧下拉菜单选择时的回调函数</td>\n<td>func</td>\n<td></td>\n<td></td>\n</tr>\n<tr>\n<td>className</td>\n<td>自定义额外类名</td>\n<td>string</td>\n<td><code>''</code></td>\n<td></td>\n</tr>\n<tr>\n<td>prefix</td>\n<td>自定义前缀</td>\n<td>string</td>\n<td><code>'zent'</code></td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<h3 class=\"anchor-heading\"><a href=\"#onselect\">¶</a><a href=\"javascript:void(0)\" id=\"onselect\" class=\"anchor-point\"></a>onSelect</h3>\n<p>回调函数内参数为dropdownValue</p>"}))}}]),a}(y.Component)}}]);