text: (self.webpackChunkzent_docs=self.webpackChunkzent_docs||[]).push([[896],{19977:(n,s,a)=>{"use strict";a.r(s),a.d(s,{default:()=>y});var t=a(73450),p=a(27378),e=a(57318),o=a(37424),c=a(24246);function l(n,s){var a=Object.keys(n);if(Object.getOwnPropertySymbols){var t=Object.getOwnPropertySymbols(n);s&&(t=t.filter((function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable}))),a.push.apply(a,t)}return a}function u(n){for(var s=1;s<arguments.length;s++){var a=null!=arguments[s]?arguments[s]:{};s%2?l(Object(a),!0).forEach((function(s){(0,t.Z)(n,s,a[s])})):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(a)):l(Object(a)).forEach((function(s){Object.defineProperty(n,s,Object.getOwnPropertyDescriptor(a,s))}))}return n}var i=function(){class n extends p.Component{constructor(...n){super(...n),(0,t.Z)(this,"state",{current:1}),(0,t.Z)(this,"onStepChange",(n=>{this.setState({current:n})}))}render(){var n=this.state.current;return(0,c.jsx)("div",{className:"zent-steps-demo-breadcrumb",children:(0,c.jsxs)(o.R,{current:n,type:"breadcrumb",onStepChange:this.onStepChange,ghost:!0,children:[(0,c.jsx)(o.R.Step,{title:"登录有赞帐号"}),(0,c.jsx)(o.R.Step,{title:"选择门店"}),(0,c.jsx)(o.R.Step,{title:"绑定门店"}),(0,c.jsx)(o.R.Step,{title:"完成"})]})})}}return(0,c.jsx)(n,{})},r=function(){class n extends p.Component{constructor(...n){super(...n),(0,t.Z)(this,"state",{current:1}),(0,t.Z)(this,"onStepChange",(n=>{this.setState({current:n})}))}render(){var n=this.state.current;return(0,c.jsx)("div",{className:"zent-steps-demo-breadcrumb",children:(0,c.jsxs)(o.R,{current:n,type:"breadcrumb",onStepChange:this.onStepChange,ghost:!0,children:[(0,c.jsx)(o.R.Step,{title:"登录有赞帐号"}),(0,c.jsx)(o.R.Step,{title:"选择门店"}),(0,c.jsx)(o.R.Step,{title:"绑定门店",disabled:!0}),(0,c.jsx)(o.R.Step,{title:"完成",disabled:!0})]})})}}return(0,c.jsx)(n,{})},k=function(){class n extends p.Component{constructor(...n){super(...n),(0,t.Z)(this,"state",{current:1}),(0,t.Z)(this,"onStepChange",(n=>{this.setState({current:n})}))}render(){var n=this.state.current;return(0,c.jsx)("div",{className:"zent-steps-demo-breadcrumb",children:(0,c.jsxs)(o.R,{current:n,type:"breadcrumb",onStepChange:this.onStepChange,sequence:!0,ghost:!0,children:[(0,c.jsx)(o.R.Step,{title:"登录有赞帐号",icon:"check-circle-o"}),(0,c.jsx)(o.R.Step,{title:"选择门店",icon:"plus-circle-o"}),(0,c.jsx)(o.R.Step,{title:"绑定门店"}),(0,c.jsx)(o.R.Step,{title:"完成"})]})})}}return(0,c.jsx)(n,{})},d=function(){return(0,c.jsxs)(o.R,{current:2,sequence:!1,type:"card",children:[(0,c.jsx)(o.R.Step,{title:"一、登录有赞帐号"}),(0,c.jsx)(o.R.Step,{title:"二、选择门店"}),(0,c.jsx)(o.R.Step,{title:"三、绑定门店"}),(0,c.jsx)(o.R.Step,{title:"四、完成"})]})},m=function(){class n extends p.Component{constructor(...n){super(...n),(0,t.Z)(this,"state",{current:1}),(0,t.Z)(this,"onStepChange",(n=>{this.setState({current:n})}))}render(){var n=this.state.current;return(0,c.jsxs)(o.R,{current:n,type:"tabs",onStepChange:this.onStepChange,children:[(0,c.jsx)(o.R.Step,{title:"第一步"}),(0,c.jsx)(o.R.Step,{title:"第二步"}),(0,c.jsx)(o.R.Step,{title:"第三步"})]})}}return(0,c.jsx)(n,{})};function h(n){return(0,c.jsx)(n.tag,u(u({},n.attributes),{},{dangerouslySetInnerHTML:{__html:n.html}}))}function g(n){return(0,c.jsx)(h,{tag:"section",html:n.html,attributes:{className:"zandoc-react-markdown"}})}function b(n){return(0,c.jsx)(h,{tag:"style",html:n.style})}function v(n,s){for(;n;)return n.offsetTop&&"static"!==getComputedStyle(n).position&&(s+=n.offsetTop),v(n.parentNode,s);return s}class S extends p.Component{constructor(...n){super(...n),(0,t.Z)(this,"state",{showCode:!1}),(0,t.Z)(this,"toggle",(()=>{this.setState({showCode:!this.state.showCode})}))}render(){var n=this.state.showCode,s=this.props,a=s.title,t=s.src,p=s.children;return(0,c.jsxs)("div",{className:"zandoc-react-demo",children:[(0,c.jsx)("div",{className:"zandoc-react-demo__preview",children:p}),(0,c.jsxs)("div",{className:"zandoc-react-demo__bottom",onClick:this.toggle,children:[(0,c.jsx)("div",{className:"zandoc-react-demo__title",children:(0,c.jsx)("p",{children:a||""})}),(0,c.jsx)("i",{className:"zenticon zenticon-caret-up zandoc-react-demo__toggle ".concat(n?"zandoc-react-demo__toggle-on":"zandoc-react-demo__toggle-off")})]}),n&&(0,c.jsx)("pre",{className:"zandoc-react-demo__code",children:(0,c.jsx)(h,{tag:"code",html:t,attributes:{className:"language-jsx"}})})]})}}class y extends p.Component{componentDidMount(){var n=location.hash;if(n){var s=document.querySelector('a[href="'.concat(n,'"]'));s&&(0,e.l)(document.documentElement,0,v(s,-9))}}render(){return p.createElement("div",{className:"zandoc-react-container"},p.createElement(b,{style:".zent-steps-demo-breadcrumb {\n\t\tbackground-color: #f7f7f7;\n\t\tpadding: 20px;\n\t}\n\n.zent-steps-demo-breadcrumb {\n\t\tbackground-color: #f7f7f7;\n\t\tpadding: 20px;\n\t}\n\n.zent-steps-demo-breadcrumb {\n\t\tbackground-color: #f7f7f7;\n\t\tpadding: 20px;\n\t}"}),p.createElement(g,{html:'<h2 class="anchor-heading"><a href="#steps-bu-zou-tiao">¶</a><a href="javascript:void(0)" id="steps-bu-zou-tiao" class="anchor-point"></a>Steps 步骤条</h2>\n<p>位于表单头部，用于大体量或强逻辑表单的分步骤展示，提供跳转能力。</p>\n<h3 class="anchor-heading"><a href="#jian-yi">¶</a><a href="javascript:void(0)" id="jian-yi" class="anchor-point"></a>建议</h3>\n<ul>\n<li>当任务复杂或存在先后关系时，步骤条将其分解成多个步骤，简化用户每一步的认知与操作成本和反馈当前状态；</li>\n<li>当大体量或强逻辑表单需要分步骤展示，且提供跳转能力，使用步骤条；</li>\n<li>当一项任务包含多个有前后关系的节点，且需要反馈任务流转状态时，使用进度指示；</li>\n<li>当一项任务仅有进度不包含多个有前后节点时，请使用进度条；</li>\n<li>当内容可拆分为多个没有前后逻辑关系的子内容时，请使用标签页；</li>\n</ul>'}),p.createElement(S,{title:"基础使用",id:"Demobreadcrumbstep",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Steps</span> <span class="token punctuation">}</span></span> <span class="token keyword module">from</span> <span class="token string">\'zent\'</span><span class="token punctuation">;</span>\n\n<span class="token keyword">class</span> <span class="token class-name">StepsExample</span> <span class="token keyword">extends</span> <span class="token class-name">Component</span> <span class="token punctuation">{</span>\n  state <span class="token operator">=</span> <span class="token punctuation">{</span>\n    current<span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>\n  <span class="token punctuation">}</span><span class="token punctuation">;</span>\n\n  <span class="token function-variable function">onStepChange</span> <span class="token operator">=</span> <span class="token parameter">id</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      current<span class="token operator">:</span> id<span class="token punctuation">,</span>\n    <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>\n  <span class="token punctuation">}</span><span class="token punctuation">;</span>\n\n  <span class="token function">render</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n    <span class="token keyword">let</span> <span class="token punctuation">{</span> current <span class="token punctuation">}</span> <span class="token operator">=</span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token property-access">state</span><span class="token punctuation">;</span>\n    <span class="token keyword control-flow">return</span> <span class="token punctuation">(</span>\n      <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">className</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>zent-steps-demo-breadcrumb<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">&lt;</span><span class="token class-name">Steps</span></span>\n          <span class="token attr-name">current</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>current<span class="token punctuation">}</span></span>\n          <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>breadcrumb<span class="token punctuation">"</span></span>\n          <span class="token attr-name">onStepChange</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">onStepChange</span><span class="token punctuation">}</span></span>\n          <span class="token attr-name">ghost</span>\n        <span class="token punctuation">></span></span>\n          <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span><span class="token class-name">Steps.Step</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>登录有赞帐号<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span>\n          <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span><span class="token class-name">Steps.Step</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>选择门店<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span>\n          <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span><span class="token class-name">Steps.Step</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>绑定门店<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span>\n          <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span><span class="token class-name">Steps.Step</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>完成<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span>\n        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span><span class="token class-name">Steps</span></span><span class="token punctuation">></span></span>\n      <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</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><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span><span class="token class-name">StepsExample</span></span> <span class="token punctuation">/></span></span><span class="token punctuation">,</span> mountNode<span class="token punctuation">)</span><span class="token punctuation">;</span>'},p.createElement(i)),p.createElement(S,{title:"禁用状态",id:"Demobreadcrumbstepdisabled",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Steps</span> <span class="token punctuation">}</span></span> <span class="token keyword module">from</span> <span class="token string">\'zent\'</span><span class="token punctuation">;</span>\n\n<span class="token keyword">class</span> <span class="token class-name">StepsExample</span> <span class="token keyword">extends</span> <span class="token class-name">Component</span> <span class="token punctuation">{</span>\n  state <span class="token operator">=</span> <span class="token punctuation">{</span>\n    current<span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>\n  <span class="token punctuation">}</span><span class="token punctuation">;</span>\n\n  <span class="token function-variable function">onStepChange</span> <span class="token operator">=</span> <span class="token parameter">id</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      current<span class="token operator">:</span> id<span class="token punctuation">,</span>\n    <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>\n  <span class="token punctuation">}</span><span class="token punctuation">;</span>\n\n  <span class="token function">render</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n    <span class="token keyword">let</span> <span class="token punctuation">{</span> current <span class="token punctuation">}</span> <span class="token operator">=</span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token property-access">state</span><span class="token punctuation">;</span>\n    <span class="token keyword control-flow">return</span> <span class="token punctuation">(</span>\n      <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">className</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>zent-steps-demo-breadcrumb<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">&lt;</span><span class="token class-name">Steps</span></span>\n          <span class="token attr-name">current</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>current<span class="token punctuation">}</span></span>\n          <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>breadcrumb<span class="token punctuation">"</span></span>\n          <span class="token attr-name">onStepChange</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">onStepChange</span><span class="token punctuation">}</span></span>\n          <span class="token attr-name">ghost</span>\n        <span class="token punctuation">></span></span>\n          <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span><span class="token class-name">Steps.Step</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>登录有赞帐号<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span>\n          <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span><span class="token class-name">Steps.Step</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>选择门店<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span>\n          <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span><span class="token class-name">Steps.Step</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>绑定门店<span class="token punctuation">"</span></span> <span class="token attr-name">disabled</span> <span class="token punctuation">/></span></span>\n          <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span><span class="token class-name">Steps.Step</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>完成<span class="token punctuation">"</span></span> <span class="token attr-name">disabled</span> <span class="token punctuation">/></span></span>\n        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span><span class="token class-name">Steps</span></span><span class="token punctuation">></span></span>\n      <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</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><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span><span class="token class-name">StepsExample</span></span> <span class="token punctuation">/></span></span><span class="token punctuation">,</span> mountNode<span class="token punctuation">)</span><span class="token punctuation">;</span>'},p.createElement(r)),p.createElement(S,{title:"自定义Icon",id:"Demobreadcrumbstepcustomicon",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Steps</span> <span class="token punctuation">}</span></span> <span class="token keyword module">from</span> <span class="token string">\'zent\'</span><span class="token punctuation">;</span>\n\n<span class="token keyword">class</span> <span class="token class-name">StepsExample</span> <span class="token keyword">extends</span> <span class="token class-name">Component</span> <span class="token punctuation">{</span>\n  state <span class="token operator">=</span> <span class="token punctuation">{</span>\n    current<span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>\n  <span class="token punctuation">}</span><span class="token punctuation">;</span>\n\n  <span class="token function-variable function">onStepChange</span> <span class="token operator">=</span> <span class="token parameter">id</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      current<span class="token operator">:</span> id<span class="token punctuation">,</span>\n    <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>\n  <span class="token punctuation">}</span><span class="token punctuation">;</span>\n\n  <span class="token function">render</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n    <span class="token keyword">let</span> <span class="token punctuation">{</span> current <span class="token punctuation">}</span> <span class="token operator">=</span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token property-access">state</span><span class="token punctuation">;</span>\n    <span class="token keyword control-flow">return</span> <span class="token punctuation">(</span>\n      <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span>div</span> <span class="token attr-name">className</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>zent-steps-demo-breadcrumb<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">&lt;</span><span class="token class-name">Steps</span></span>\n          <span class="token attr-name">current</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>current<span class="token punctuation">}</span></span>\n          <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>breadcrumb<span class="token punctuation">"</span></span>\n          <span class="token attr-name">onStepChange</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">onStepChange</span><span class="token punctuation">}</span></span>\n          <span class="token attr-name">sequence</span>\n          <span class="token attr-name">ghost</span>\n        <span class="token punctuation">></span></span>\n          <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span><span class="token class-name">Steps.Step</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>登录有赞帐号<span class="token punctuation">"</span></span> <span class="token attr-name">icon</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>check-circle-o<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">&lt;</span><span class="token class-name">Steps.Step</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>选择门店<span class="token punctuation">"</span></span> <span class="token attr-name">icon</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>plus-circle-o<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">&lt;</span><span class="token class-name">Steps.Step</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>绑定门店<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span>\n          <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span><span class="token class-name">Steps.Step</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>完成<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span>\n        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span><span class="token class-name">Steps</span></span><span class="token punctuation">></span></span>\n      <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</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><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span><span class="token class-name">StepsExample</span></span> <span class="token punctuation">/></span></span><span class="token punctuation">,</span> mountNode<span class="token punctuation">)</span><span class="token punctuation">;</span>'},p.createElement(k)),p.createElement(g,{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="#steps">¶</a><a href="javascript:void(0)" id="steps" class="anchor-point"></a>Steps</h4>\n<table class="table">\n<thead>\n<tr>\n<th>参数</th>\n<th>说明</th>\n<th>类型</th>\n<th>默认值</th>\n<th>备选值</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>type</td>\n<td>steps 组件类型</td>\n<td>string</td>\n<td><code>\'number\'</code></td>\n<td><code>\'card\'</code>\n, \n<code>\'breadcrumb\'</code>\n, \n<code>\'tabs\'</code></td>\n</tr>\n<tr>\n<td>direction</td>\n<td>步骤条的方向（竖直只针对 number 类型步骤条有效）</td>\n<td>string</td>\n<td><code>\'horizontal\'</code></td>\n<td><code>\'vertical\'</code></td>\n</tr>\n<tr>\n<td>current</td>\n<td>指定当前步骤, 从 1 开始记数 (当不传值时, 默认为 0, 状态都为 wait)</td>\n<td>number</td>\n<td><code>0</code></td>\n<td></td>\n</tr>\n<tr>\n<td>status</td>\n<td>步骤条的状态</td>\n<td>string</td>\n<td><code>\'process\'</code></td>\n<td><code>\'wait\'</code>\n, \n<code>\'finish\'</code>\n, \n<code>\'error\'</code></td>\n</tr>\n<tr>\n<td>sequence</td>\n<td>是否使用默认的步骤序号</td>\n<td>boolean</td>\n<td><code>true</code></td>\n<td></td>\n</tr>\n<tr>\n<td>onStepChange</td>\n<td>传该参数后 step 可点击切换 (针对 card, breadcrumb，tabs 类型)</td>\n<td>func</td>\n<td><code>\'\'</code></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>ghost</td>\n<td>是否使用反色样式（仅支持 breadcrumb 类型）</td>\n<td>boolean</td>\n<td>false</td>\n<td></td>\n</tr>\n</tbody>\n</table>\n<p><strong>[type=number]类型的进度指示器请使用 Indicator 组件</strong></p>\n<h4 class="anchor-heading"><a href="#steps-step">¶</a><a href="javascript:void(0)" id="steps-step" class="anchor-point"></a>Steps.Step</h4>\n<p>步骤条的每一个子项</p>\n<table class="table">\n<thead>\n<tr>\n<th>参数</th>\n<th>说明</th>\n<th>类型</th>\n</tr>\n</thead>\n<tbody>\n<tr>\n<td>title</td>\n<td>标题</td>\n<td><code>\'node\'</code></td>\n</tr>\n<tr>\n<td>description</td>\n<td>步骤的详情描述 (card, breadcrumb, tabs 类型不支持该属性)</td>\n<td><code>\'node\'</code></td>\n</tr>\n<tr>\n<td>icon</td>\n<td>自定义图标</td>\n<td><code>\'string\'</code>\n \n|\n \n<code>\'node\'</code></td>\n</tr>\n</tbody>\n</table>\n<h3 class="anchor-heading"><a href="#yi-zhi-wen-ti">¶</a><a href="javascript:void(0)" id="yi-zhi-wen-ti" class="anchor-point"></a>已知问题</h3>\n<p>尚未处理步骤条只存在一项的边界情况。(当只有一项时不应该使用 steps)</p>\n<h4 class="anchor-heading"><a href="#yi-xia-gong-neng-xin-ban-she-ji-yu-yan-yi-fei-qi-jin-zuo-wei-lao-ban-shi-yong-de-can-kao">¶</a><a href="javascript:void(0)" id="yi-xia-gong-neng-xin-ban-she-ji-yu-yan-yi-fei-qi-jin-zuo-wei-lao-ban-shi-yong-de-can-kao" class="anchor-point"></a>以下功能新版设计语言已废弃，仅作为老版使用的参考</h4>'}),p.createElement(S,{title:"类型为 card 的步骤条（通过 sequence 覆写步骤项序号）",id:"Democardstep",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Steps</span> <span class="token punctuation">}</span></span> <span class="token keyword module">from</span> <span class="token string">\'zent\'</span><span class="token punctuation">;</span>\n\n<span class="token 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">&lt;</span><span class="token class-name">Steps</span></span> <span class="token attr-name">current</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token number">2</span><span class="token punctuation">}</span></span> <span class="token attr-name">sequence</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span><span class="token boolean">false</span><span class="token punctuation">}</span></span> <span class="token attr-name">type</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>card<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">&lt;</span><span class="token class-name">Steps.Step</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>一、登录有赞帐号<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span>\n    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span><span class="token class-name">Steps.Step</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>二、选择门店<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span>\n    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span><span class="token class-name">Steps.Step</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>三、绑定门店<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span>\n    <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span><span class="token class-name">Steps.Step</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>四、完成<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span>\n  <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span><span class="token class-name">Steps</span></span><span class="token punctuation">></span></span><span class="token punctuation">,</span>\n  mountNode\n<span class="token punctuation">)</span><span class="token punctuation">;</span>'},p.createElement(d)),p.createElement(S,{title:"类型为 tabs 的步骤条",id:"Demotabsstep",src:'<span class="token keyword module">import</span> <span class="token imports"><span class="token punctuation">{</span> <span class="token maybe-class-name">Steps</span> <span class="token punctuation">}</span></span> <span class="token keyword module">from</span> <span class="token string">\'zent\'</span><span class="token punctuation">;</span>\n\n<span class="token keyword">class</span> <span class="token class-name">StepsExample</span> <span class="token keyword">extends</span> <span class="token class-name">Component</span> <span class="token punctuation">{</span>\n  state <span class="token operator">=</span> <span class="token punctuation">{</span>\n    current<span class="token operator">:</span> <span class="token number">1</span><span class="token punctuation">,</span>\n  <span class="token punctuation">}</span><span class="token punctuation">;</span>\n\n  <span class="token function-variable function">onStepChange</span> <span class="token operator">=</span> <span class="token parameter">id</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      current<span class="token operator">:</span> id<span class="token punctuation">,</span>\n    <span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>\n  <span class="token punctuation">}</span><span class="token punctuation">;</span>\n\n  <span class="token function">render</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>\n    <span class="token keyword">let</span> <span class="token punctuation">{</span> current <span class="token punctuation">}</span> <span class="token operator">=</span> <span class="token keyword">this</span><span class="token punctuation">.</span><span class="token property-access">state</span><span class="token punctuation">;</span>\n    <span class="token keyword control-flow">return</span> <span class="token punctuation">(</span>\n      <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span><span class="token class-name">Steps</span></span> <span class="token attr-name">current</span><span class="token script language-javascript"><span class="token script-punctuation punctuation">=</span><span class="token punctuation">{</span>current<span class="token punctuation">}</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>tabs<span class="token punctuation">"</span></span> <span class="token attr-name">onStepChange</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">onStepChange</span><span class="token punctuation">}</span></span><span class="token punctuation">></span></span>\n        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span><span class="token class-name">Steps.Step</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>第一步<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span>\n        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span><span class="token class-name">Steps.Step</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>第二步<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span>\n        <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span><span class="token class-name">Steps.Step</span></span> <span class="token attr-name">title</span><span class="token attr-value"><span class="token punctuation attr-equals">=</span><span class="token punctuation">"</span>第三步<span class="token punctuation">"</span></span> <span class="token punctuation">/></span></span>\n      <span class="token tag"><span class="token tag"><span class="token punctuation">&lt;/</span><span class="token class-name">Steps</span></span><span class="token punctuation">></span></span>\n    <span class="token punctuation">)</span><span class="token punctuation">;</span>\n  <span class="token punctuation">}</span>\n<span class="token punctuation">}</span>\n\n<span class="token maybe-class-name">ReactDOM</span><span class="token punctuation">.</span><span class="token method function property-access">render</span><span class="token punctuation">(</span><span class="token tag"><span class="token tag"><span class="token punctuation">&lt;</span><span class="token class-name">StepsExample</span></span> <span class="token punctuation">/></span></span><span class="token punctuation">,</span> mountNode<span class="token punctuation">)</span><span class="token punctuation">;</span>'},p.createElement(m)))}}},37424:(n,s,a)=>{"use strict";a.d(s,{R:()=>d});var t=a(93646),p=a(24246),e=a(27378),o=a(60042),c=a.n(o),l=a(27036),u=function(n){function s(){var s=null!==n&&n.apply(this,arguments)||this;return s.renderIconNode=function(){var n=s.props,a=n.stepNumber,e=n.sequence,o=n.status,c=void 0===o?"wait":o,u=n.icon;if(u){var i="string"==typeof u?(0,p.jsx)(l.Z,{type:u},void 0):u;return(0,p.jsx)(p.Fragment,{children:i},void 0)}return"finish"===c?(0,p.jsx)(l.Z,{type:"check-circle-o"},void 0):"error"===c?(0,p.jsx)(l.Z,{type:"error-circle"},void 0):(0,p.jsx)("span",(0,t.pi)({className:"zent-icon zent-steps-sequence","data-zv":"10.0.0-beta.1"},{children:e?a:""}),void 0)},s}return(0,t.ZT)(s,n),s.prototype.render=function(){var n=this.props,s=n.isCurrentStep,a=n.status,e=void 0===a?"wait":a,o=n.isLastFinishStep,l=n.stepLast,u=n.title,i=n.description,r=c()("zent-steps-item","zent-steps-status-"+e,{"zent-steps-item--current":s,"zent-steps-item--last-finished":o});return(0,p.jsxs)("div",(0,t.pi)({className:r,"data-zv":"10.0.0-beta.1"},{children:[!l&&(0,p.jsx)("div",(0,t.pi)({className:"zent-steps-tail","data-zv":"10.0.0-beta.1"},{children:(0,p.jsx)("i",{"data-zv":"10.0.0-beta.1"},void 0)}),void 0),(0,p.jsxs)("div",(0,t.pi)({className:"zent-steps-step","data-zv":"10.0.0-beta.1"},{children:[(0,p.jsx)("div",(0,t.pi)({className:"zent-step-head","data-zv":"10.0.0-beta.1"},{children:(0,p.jsx)("div",(0,t.pi)({className:"zent-step-head-inner","data-zv":"10.0.0-beta.1"},{children:this.renderIconNode()}),void 0)}),void 0),(0,p.jsxs)("div",(0,t.pi)({className:"zent-step-main","data-zv":"10.0.0-beta.1"},{children:[(0,p.jsx)("div",(0,t.pi)({className:"zent-step-title","data-zv":"10.0.0-beta.1"},{children:u}),void 0),i&&(0,p.jsx)("div",(0,t.pi)({className:"zent-step-description","data-zv":"10.0.0-beta.1"},{children:i}),void 0)]}),void 0)]}),void 0)]}),void 0)},s.defaultProps={description:""},s}(e.Component),i=a(19185),r=function(n){function s(){return null!==n&&n.apply(this,arguments)||this}return(0,t.ZT)(s,n),s.prototype.render=function(){var n=this.props,s=n.className,a=n.children,o=n.current,l=n.status,u=n.direction,r=n.sequence,k=e.Children.count(a)-1,d=c()(s,"zent-steps","zent-steps__"+u);return(0,p.jsx)("div",(0,t.pi)({className:d,"data-zv":"10.0.0-beta.1"},{children:e.Children.map(a,(function(n,s){var a={sequence:r,stepNumber:(s+1).toString(),stepLast:s===k,isCurrentStep:s===o-1,isLastFinishStep:"error"===l&&s===o-2,status:"wait"};return(0,i.isElement)(n)?(n.props.status||(a.status=s===o-1?l:s<o-1?"finish":"wait"),(0,e.cloneElement)(n,a)):null}))}),void 0)},s}(e.Component),k=function(n){function s(){var s=null!==n&&n.apply(this,arguments)||this;return s.onStepChange=function(n){var a=s.props.onStepChange;a&&a(n)},s.renderStepTitle=function(n,a){var e=s.props,o=e.sequence,c=e.ghost,u=n.icon,i=n.title;if(u){var r="string"==typeof u?(0,p.jsx)(l.Z,{type:u,className:"zent-steps-item__icon"},void 0):u;return(0,p.jsxs)(p.Fragment,{children:[r,i]},void 0)}return o?(0,p.jsxs)(p.Fragment,{children:[c?(0,p.jsx)("span",(0,t.pi)({className:"zent-steps-sequence","data-zv":"10.0.0-beta.1"},{children:a+1}),void 0):a+1+". ",i]},void 0):i},s}return(0,t.ZT)(s,n),s.prototype.render=function(){var n=this,s=this.props,a=s.className,o=s.children,l=s.current,u=s.onStepChange,r=s.type,k=s.ghost,d=100/e.Children.count(o)+"%",m="breadcrumb"===r,h="card"===r,g="tabs"===r,b=k&&m,v=c()("zent-steps",a,{"zent-steps-breadcrumb":m,"zent-steps-card":h,"zent-steps-tabs":g,"zent-steps-breadcrumb-ghost":b});return(0,p.jsx)("div",(0,t.pi)({className:v,"data-zv":"10.0.0-beta.1"},{children:e.Children.map(o,(function(s,a){if(!(0,i.isElement)(s))return null;var e=s.props.disabled&&b,o=c()("zent-steps-item",{"zent-steps-item--finished":m&&a<=l-1,"zent-steps-item--current":(h||g||b)&&a===l-1,"zent-steps-item--clickable":Boolean(u),"zent-steps-item--disabled":e});return(0,p.jsx)("div",(0,t.pi)({className:o,style:{width:d},onClick:function(){return!e&&n.onStepChange(a+1)},"data-zv":"10.0.0-beta.1"},{children:(0,p.jsx)("div",(0,t.pi)({className:"zent-steps-step","data-zv":"10.0.0-beta.1"},{children:n.renderStepTitle(s.props,a)}),void 0)}),void 0)}))}),void 0)},s}(e.Component),d=function(n){function s(){return null!==n&&n.apply(this,arguments)||this}return(0,t.ZT)(s,n),s.prototype.render=function(){var n=this.props,s=n.type,a=n.children,e=(0,t._T)(n,["type","children"]),o={number:r,card:k,breadcrumb:k,tabs:k}[s];return(0,p.jsx)(o,(0,t.pi)({},e,{type:s},{children:a}),void 0)},s.defaultProps={className:"",type:"number",current:0,direction:"horizontal",size:"normal",status:"process",sequence:!0,ghost:!1},s.Step=u,s}(e.Component)}}]);