mirror of
https://github.com/wahyd4/ant-design.git
synced 2026-08-22 11:16:35 +10:00
1138 lines
38 KiB
HTML
1138 lines
38 KiB
HTML
<!DOCTYPE html>
|
|
<html>
|
|
<head>
|
|
<meta charset="utf-8">
|
|
<meta http-equiv="X-UA-Compatible" content="IE=edge">
|
|
<meta name="viewport" content="width=device-width, initial-scale=1.0">
|
|
<meta name="apple-mobile-web-app-capable" content="yes">
|
|
<meta name="apple-mobile-web-app-status-bar-style" content="black">
|
|
<meta name="format-detection" content="telephone=no">
|
|
<meta name="description" content="一个 UI 设计语言"/>
|
|
<title>
|
|
Steps 步骤条 - Ant Design
|
|
</title>
|
|
<link rel="icon" href="https://t.alipayobjects.com/images/T1QUBfXo4fXXXXXXXX.png" type="image/x-icon">
|
|
<link rel="shortcut icon" href="https://t.alipayobjects.com/images/T1QUBfXo4fXXXXXXXX.png" type="image/x-icon">
|
|
|
|
<link rel="stylesheet" href="../../dist/demo.css?20160114">
|
|
<script src="https://as.alipayobjects.com/g/component/??console-polyfill/0.2.2/index.js,es5-shim/4.1.14/es5-shim.min.js,es5-shim/4.1.14/es5-sham.min.js,html5shiv/3.7.2/html5shiv.min.js,media-match/2.0.2/media.match.min.js,jquery/1.11.3/jquery.min.js,bluebird/3.1.1/bluebird.min.js"></script>
|
|
<script>
|
|
(function() {
|
|
window.ANT_COMPONENTS = [];
|
|
window.InstantClickChangeFns = [];
|
|
ANT_COMPONENTS.push({
|
|
title: 'Pagination',
|
|
desc: '分页'
|
|
});
|
|
ANT_COMPONENTS.push({
|
|
title: 'Affix',
|
|
desc: '固钉'
|
|
});
|
|
ANT_COMPONENTS.push({
|
|
title: 'Badge',
|
|
desc: '徽标数'
|
|
});
|
|
ANT_COMPONENTS.push({
|
|
title: 'Breadcrumb',
|
|
desc: '面包屑'
|
|
});
|
|
ANT_COMPONENTS.push({
|
|
title: 'Button',
|
|
desc: '按钮'
|
|
});
|
|
ANT_COMPONENTS.push({
|
|
title: 'Calendar',
|
|
desc: '日历'
|
|
});
|
|
ANT_COMPONENTS.push({
|
|
title: 'Carousel',
|
|
desc: '走马灯'
|
|
});
|
|
ANT_COMPONENTS.push({
|
|
title: 'Cascader',
|
|
desc: '级联选择'
|
|
});
|
|
ANT_COMPONENTS.push({
|
|
title: 'Checkbox',
|
|
desc: '多选框'
|
|
});
|
|
ANT_COMPONENTS.push({
|
|
title: 'Collapse',
|
|
desc: '折叠面板'
|
|
});
|
|
ANT_COMPONENTS.push({
|
|
title: 'DatePicker',
|
|
desc: '日期选择框'
|
|
});
|
|
ANT_COMPONENTS.push({
|
|
title: 'Dropdown',
|
|
desc: '下拉菜单'
|
|
});
|
|
ANT_COMPONENTS.push({
|
|
title: 'Form',
|
|
desc: '表单'
|
|
});
|
|
ANT_COMPONENTS.push({
|
|
title: 'Icon',
|
|
desc: '图标'
|
|
});
|
|
ANT_COMPONENTS.push({
|
|
title: 'InputNumber',
|
|
desc: '数字输入框'
|
|
});
|
|
ANT_COMPONENTS.push({
|
|
title: 'Layout',
|
|
desc: '布局'
|
|
});
|
|
ANT_COMPONENTS.push({
|
|
title: 'Menu',
|
|
desc: '导航菜单'
|
|
});
|
|
ANT_COMPONENTS.push({
|
|
title: 'Message',
|
|
desc: '全局提示'
|
|
});
|
|
ANT_COMPONENTS.push({
|
|
title: 'Modal',
|
|
desc: '对话框'
|
|
});
|
|
ANT_COMPONENTS.push({
|
|
title: 'Notification',
|
|
desc: '通知提醒框'
|
|
});
|
|
ANT_COMPONENTS.push({
|
|
title: 'Alert',
|
|
desc: '警告提示'
|
|
});
|
|
ANT_COMPONENTS.push({
|
|
title: 'Popconfirm',
|
|
desc: '气泡确认框'
|
|
});
|
|
ANT_COMPONENTS.push({
|
|
title: 'Popover',
|
|
desc: '气泡卡片'
|
|
});
|
|
ANT_COMPONENTS.push({
|
|
title: 'Progress',
|
|
desc: '进度条'
|
|
});
|
|
ANT_COMPONENTS.push({
|
|
title: 'QueueAnim',
|
|
desc: '进出场动画'
|
|
});
|
|
ANT_COMPONENTS.push({
|
|
title: 'Radio',
|
|
desc: '单选框'
|
|
});
|
|
ANT_COMPONENTS.push({
|
|
title: 'Select',
|
|
desc: '选择器'
|
|
});
|
|
ANT_COMPONENTS.push({
|
|
title: 'Slider',
|
|
desc: '滑动输入条'
|
|
});
|
|
ANT_COMPONENTS.push({
|
|
title: 'Spin',
|
|
desc: '加载中'
|
|
});
|
|
ANT_COMPONENTS.push({
|
|
title: 'Steps',
|
|
desc: '步骤条'
|
|
});
|
|
ANT_COMPONENTS.push({
|
|
title: 'Switch',
|
|
desc: '开关'
|
|
});
|
|
ANT_COMPONENTS.push({
|
|
title: 'Table',
|
|
desc: '表格'
|
|
});
|
|
ANT_COMPONENTS.push({
|
|
title: 'Tabs',
|
|
desc: '标签页'
|
|
});
|
|
ANT_COMPONENTS.push({
|
|
title: 'Tag',
|
|
desc: '标签'
|
|
});
|
|
ANT_COMPONENTS.push({
|
|
title: 'TimePicker',
|
|
desc: '时间选择框'
|
|
});
|
|
ANT_COMPONENTS.push({
|
|
title: 'Timeline',
|
|
desc: '时间轴'
|
|
});
|
|
ANT_COMPONENTS.push({
|
|
title: 'Tooltip',
|
|
desc: '文字提示'
|
|
});
|
|
ANT_COMPONENTS.push({
|
|
title: 'Transfer',
|
|
desc: '穿梭框'
|
|
});
|
|
ANT_COMPONENTS.push({
|
|
title: 'Tree',
|
|
desc: '树形控件'
|
|
});
|
|
ANT_COMPONENTS.push({
|
|
title: 'TreeSelect',
|
|
desc: '树选择'
|
|
});
|
|
ANT_COMPONENTS.push({
|
|
title: 'Upload',
|
|
desc: '文件上传'
|
|
});
|
|
// fix ie location origin
|
|
// http://stackoverflow.com/questions/22564167/window-location-origin-gives-wrong-value-when-using-ie
|
|
if (!window.location.origin) {
|
|
window.location.origin = window.location.protocol + "//"
|
|
+ window.location.hostname
|
|
+ (window.location.port ? ':' + window.location.port : '');
|
|
}
|
|
var i = location.pathname.split('/').lastIndexOf('ant-design');
|
|
if (i > 0) {
|
|
window.rootUrl = location.origin + location.pathname.split('/').slice(0, 2+1).join('/');
|
|
} else {
|
|
window.rootUrl = location.origin;
|
|
}
|
|
})();
|
|
</script>
|
|
<script>
|
|
window.antdVersion = {
|
|
latest: '0.12.8'
|
|
};
|
|
</script>
|
|
<script src="../../dist/demo.js?20160114"></script>
|
|
|
|
</head>
|
|
<body >
|
|
<header id="header" class="clearfix">
|
|
<a class="logo" href="../..">
|
|
<img width="60" src="https://t.alipayobjects.com/images/rmsweb/T1B9hfXcdvXXXXXXXX.svg">
|
|
Ant Design
|
|
</a>
|
|
<div class="search">
|
|
<div id="autoComplete"></div>
|
|
</div>
|
|
<nav class="nav" tabindex="-1">
|
|
<span class="bar"></span>
|
|
<ul>
|
|
<li class="">
|
|
<a href="../..">首页</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../../docs/practice/cases">实践</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../../docs/pattern/navigation">模式</a>
|
|
</li>
|
|
<li class="current">
|
|
<a href="../../docs/react/introduce">组件</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../../docs/spec/introduce">语言</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../../docs/resource/download">资源</a>
|
|
</li>
|
|
</ul>
|
|
</nav>
|
|
<div class="nav-phone-icon"></div>
|
|
</header>
|
|
<div class="main-wrapper">
|
|
|
|
<aside class="aside-container">
|
|
<ul>
|
|
<li class="">
|
|
<a href="../../docs/react/introduce"
|
|
class="">
|
|
Ant Design of React
|
|
<span class="chinese"></span>
|
|
</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../../docs/react/getting-started"
|
|
class="">
|
|
快速上手
|
|
<span class="chinese"></span>
|
|
</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../../docs/react/install"
|
|
class="">
|
|
安装
|
|
<span class="chinese"></span>
|
|
</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../../docs/react/upgrade-notes"
|
|
class="">
|
|
升级指南
|
|
<span class="chinese"></span>
|
|
</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../../changelog"
|
|
class="">
|
|
更新日志
|
|
<span class="chinese"></span>
|
|
</a>
|
|
</li>
|
|
<li open="open">
|
|
<h4>Components</h4>
|
|
<ul class="">
|
|
<li class="type-divider">基本</li>
|
|
<li class="">
|
|
<a href="../button/"
|
|
class="">
|
|
Button
|
|
<span class="chinese">按钮</span>
|
|
</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../icon/"
|
|
class="">
|
|
Icon
|
|
<span class="chinese">图标</span>
|
|
</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../layout/"
|
|
class="">
|
|
Layout
|
|
<span class="chinese">布局</span>
|
|
</a>
|
|
</li>
|
|
<li class="type-divider">表单</li>
|
|
<li class="">
|
|
<a href="../cascader/"
|
|
class="">
|
|
Cascader
|
|
<span class="chinese">级联选择</span>
|
|
</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../checkbox/"
|
|
class="">
|
|
Checkbox
|
|
<span class="chinese">多选框</span>
|
|
</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../date-picker/"
|
|
class="">
|
|
DatePicker
|
|
<span class="chinese">日期选择框</span>
|
|
</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../form/"
|
|
class="">
|
|
Form
|
|
<span class="chinese">表单</span>
|
|
</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../input-number/"
|
|
class="">
|
|
InputNumber
|
|
<span class="chinese">数字输入框</span>
|
|
</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../radio/"
|
|
class="">
|
|
Radio
|
|
<span class="chinese">单选框</span>
|
|
</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../select/"
|
|
class="">
|
|
Select
|
|
<span class="chinese">选择器</span>
|
|
</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../slider/"
|
|
class="">
|
|
Slider
|
|
<span class="chinese">滑动输入条</span>
|
|
</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../switch/"
|
|
class="">
|
|
Switch
|
|
<span class="chinese">开关</span>
|
|
</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../time-picker/"
|
|
class="">
|
|
TimePicker
|
|
<span class="chinese">时间选择框</span>
|
|
</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../transfer/"
|
|
class="">
|
|
Transfer
|
|
<span class="chinese">穿梭框</span>
|
|
</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../tree-select/"
|
|
class="">
|
|
TreeSelect
|
|
<span class="chinese">树选择</span>
|
|
</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../upload/"
|
|
class="">
|
|
Upload
|
|
<span class="chinese">文件上传</span>
|
|
</a>
|
|
</li>
|
|
<li class="type-divider">展示</li>
|
|
<li class="">
|
|
<a href="../alert/"
|
|
class="">
|
|
Alert
|
|
<span class="chinese">警告提示</span>
|
|
</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../badge/"
|
|
class="">
|
|
Badge
|
|
<span class="chinese">徽标数</span>
|
|
</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../calendar/"
|
|
class="">
|
|
Calendar
|
|
<span class="chinese">日历</span>
|
|
</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../carousel/"
|
|
class="">
|
|
Carousel
|
|
<span class="chinese">走马灯</span>
|
|
</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../collapse/"
|
|
class="">
|
|
Collapse
|
|
<span class="chinese">折叠面板</span>
|
|
</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../dropdown/"
|
|
class="">
|
|
Dropdown
|
|
<span class="chinese">下拉菜单</span>
|
|
</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../message/"
|
|
class=""data-no-instant>
|
|
Message
|
|
<span class="chinese">全局提示</span>
|
|
</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../modal/"
|
|
class="">
|
|
Modal
|
|
<span class="chinese">对话框</span>
|
|
</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../notification/"
|
|
class=""data-no-instant>
|
|
Notification
|
|
<span class="chinese">通知提醒框</span>
|
|
</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../popconfirm/"
|
|
class="">
|
|
Popconfirm
|
|
<span class="chinese">气泡确认框</span>
|
|
</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../popover/"
|
|
class="">
|
|
Popover
|
|
<span class="chinese">气泡卡片</span>
|
|
</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../progress/"
|
|
class="">
|
|
Progress
|
|
<span class="chinese">进度条</span>
|
|
</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../table/"
|
|
class="">
|
|
Table
|
|
<span class="chinese">表格</span>
|
|
</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../tag/"
|
|
class="">
|
|
Tag
|
|
<span class="chinese">标签</span>
|
|
</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../timeline/"
|
|
class="">
|
|
Timeline
|
|
<span class="chinese">时间轴</span>
|
|
</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../tooltip/"
|
|
class="">
|
|
Tooltip
|
|
<span class="chinese">文字提示</span>
|
|
</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../tree/"
|
|
class="">
|
|
Tree
|
|
<span class="chinese">树形控件</span>
|
|
</a>
|
|
</li>
|
|
<li class="type-divider">导航</li>
|
|
<li class="">
|
|
<a href="../breadcrumb/"
|
|
class="">
|
|
Breadcrumb
|
|
<span class="chinese">面包屑</span>
|
|
</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../menu/"
|
|
class="">
|
|
Menu
|
|
<span class="chinese">导航菜单</span>
|
|
</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../pagination/"
|
|
class="">
|
|
Pagination
|
|
<span class="chinese">分页</span>
|
|
</a>
|
|
</li>
|
|
<li class="current">
|
|
<a href="./"
|
|
class="">
|
|
Steps
|
|
<span class="chinese">步骤条</span>
|
|
</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../tabs/"
|
|
class="">
|
|
Tabs
|
|
<span class="chinese">标签页</span>
|
|
</a>
|
|
</li>
|
|
<li class="type-divider">其他</li>
|
|
<li class="">
|
|
<a href="../affix/"
|
|
class="">
|
|
Affix
|
|
<span class="chinese">固钉</span>
|
|
</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../queue-anim/"
|
|
class="">
|
|
QueueAnim
|
|
<span class="chinese">进出场动画</span>
|
|
</a>
|
|
</li>
|
|
<li class="">
|
|
<a href="../spin/"
|
|
class="">
|
|
Spin
|
|
<span class="chinese">加载中</span>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
</li>
|
|
</ul>
|
|
</aside>
|
|
|
|
<section class="main-container">
|
|
<article class="markdown">
|
|
<h1>
|
|
Steps 步骤条
|
|
</h1>
|
|
<p>引导用户按照流程完成任务的导航条。</p>
|
|
<h2 id="何时使用">何时使用<a href="#何时使用" class="anchor">#</a> </h2><p>当任务复杂或者存在先后关系时,将其分解成一系列步骤,从而简化任务。</p>
|
|
<h2 id="api">API<a href="#api" class="anchor">#</a> </h2><div class="highlight"><pre><code class="javascript"><Steps>
|
|
<span class="xml"><span class="hljs-tag"><<span class="hljs-title">Step</span> <span class="hljs-attribute">title</span>=<span class="hljs-value">"第一步"</span> /></span>
|
|
<span class="hljs-tag"><<span class="hljs-title">Step</span> <span class="hljs-attribute">title</span>=<span class="hljs-value">"第二步"</span> /></span>
|
|
<span class="hljs-tag"><<span class="hljs-title">Step</span> <span class="hljs-attribute">title</span>=<span class="hljs-value">"第三步"</span> /></span>
|
|
<span class="hljs-tag"></<span class="hljs-title">Steps</span>></span></span></code></pre></div><h3 id="steps">Steps<a href="#steps" class="anchor">#</a> </h3><p>整体步骤条。</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>参数</th>
|
|
<th>说明</th>
|
|
<th>类型</th>
|
|
<th>可选值</th>
|
|
<th>默认值</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>current</td>
|
|
<td>可选参数,指定当前处理正在执行状态的步骤,从0开始记数。在子Step元素中,可以通过status属性覆盖状态。</td>
|
|
<td>number</td>
|
|
<td>无</td>
|
|
<td>0</td>
|
|
</tr>
|
|
<tr>
|
|
<td>size</td>
|
|
<td>可选参数,指定大小(目前只支持普通和迷你两种大小)。</td>
|
|
<td>string</td>
|
|
<td>small, default</td>
|
|
<td>default</td>
|
|
</tr>
|
|
<tr>
|
|
<td>direction</td>
|
|
<td>可选参数,指定步骤条方向(目前支持水平和竖直两种方向,默认水平方向)。</td>
|
|
<td>string</td>
|
|
<td>vertical</td>
|
|
<td>无</td>
|
|
</tr>
|
|
<tr>
|
|
<td>maxDescriptionWidth</td>
|
|
<td>可选参数,指定步骤的详细描述文字的最大宽度。</td>
|
|
<td>number</td>
|
|
<td>无</td>
|
|
<td>100</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
<h3 id="steps-step">Steps.Step<a href="#steps-step" class="anchor">#</a> </h3><p>步骤条内的每一个步。</p>
|
|
<table>
|
|
<thead>
|
|
<tr>
|
|
<th>参数</th>
|
|
<th>说明</th>
|
|
<th>类型</th>
|
|
<th>可选值</th>
|
|
<th>默认值</th>
|
|
</tr>
|
|
</thead>
|
|
<tbody>
|
|
<tr>
|
|
<td>status</td>
|
|
<td>可选参数,指定状态。当不配置该属性时,会使用父Steps元素的current来自动指定状态。</td>
|
|
<td>string</td>
|
|
<td>wait, process, finish</td>
|
|
<td>wait</td>
|
|
</tr>
|
|
<tr>
|
|
<td>title</td>
|
|
<td>必要参数,标题。</td>
|
|
<td>string/jsx</td>
|
|
<td>无</td>
|
|
<td>无</td>
|
|
</tr>
|
|
<tr>
|
|
<td>description</td>
|
|
<td>可选参数,步骤的详情描述。</td>
|
|
<td>string/jsx</td>
|
|
<td>无</td>
|
|
<td>空</td>
|
|
</tr>
|
|
<tr>
|
|
<td>icon</td>
|
|
<td>可选参数,步骤的Icon。如果不指定,则使用默认的样式。</td>
|
|
<td>string/jsx</td>
|
|
<td>无</td>
|
|
<td>空</td>
|
|
</tr>
|
|
</tbody>
|
|
</table>
|
|
|
|
</article>
|
|
<h2 class="component-demos">
|
|
代码演示
|
|
<i class="anticon anticon-appstore icon-all" title="展开全部代码"></i>
|
|
</h2>
|
|
<div class="code-boxes">
|
|
<div class="code-boxes-col-1-1"><div class="code-box" id="demo-simple">
|
|
<div class="code-box-demo">
|
|
<div id="components-steps-demo-simple"></div>
|
|
<script>mountNode = document.getElementById('components-steps-demo-simple');</script>
|
|
<script>(function(){'use strict';
|
|
|
|
var _antd = require('antd');
|
|
|
|
var Step = _antd.Steps.Step;
|
|
|
|
var steps = [{
|
|
title: '已完成',
|
|
description: '这里是多信息的描述啊'
|
|
}, {
|
|
title: '进行中',
|
|
description: '这里是多信息的耶哦耶哦哦耶哦耶'
|
|
}, {
|
|
title: '又一个待运行',
|
|
description: '描述啊描述啊'
|
|
}, {
|
|
title: '待运行',
|
|
description: '这里是多信息的描述啊'
|
|
}].map(function (s, i) {
|
|
return React.createElement(Step, { key: i, title: s.title, description: s.description });
|
|
});
|
|
|
|
ReactDOM.render(React.createElement(
|
|
_antd.Steps,
|
|
{ current: 1 },
|
|
steps
|
|
), mountNode);})()</script><div class="highlight"><pre><code class="javascript"><span class="hljs-keyword">import</span> { Steps } <span class="hljs-keyword">from</span> <span class="hljs-string">'antd'</span>;
|
|
<span class="hljs-keyword">const</span> Step = Steps.Step;
|
|
|
|
<span class="hljs-keyword">const</span> steps = [{
|
|
title: <span class="hljs-string">'已完成'</span>,
|
|
description: <span class="hljs-string">'这里是多信息的描述啊'</span>
|
|
}, {
|
|
title: <span class="hljs-string">'进行中'</span>,
|
|
description: <span class="hljs-string">'这里是多信息的耶哦耶哦哦耶哦耶'</span>
|
|
}, {
|
|
title: <span class="hljs-string">'又一个待运行'</span>,
|
|
description: <span class="hljs-string">'描述啊描述啊'</span>
|
|
}, {
|
|
title: <span class="hljs-string">'待运行'</span>,
|
|
description: <span class="hljs-string">'这里是多信息的描述啊'</span>
|
|
}].map((s, i) => <span class="xml"><span class="hljs-tag"><<span class="hljs-title">Step</span> <span class="hljs-attribute">key</span>=<span class="hljs-value">{i}</span> <span class="hljs-attribute">title</span>=<span class="hljs-value">{s.title}</span> <span class="hljs-attribute">description</span>=<span class="hljs-value">{s.description}</span> /></span>)</span>;
|
|
|
|
ReactDOM.render(<span class="xml"><span class="hljs-tag"><<span class="hljs-title">Steps</span> <span class="hljs-attribute">current</span>=<span class="hljs-value">{1}</span>></span>{steps}<span class="hljs-tag"></<span class="hljs-title">Steps</span>></span>, mountNode);</span></code></pre></div>
|
|
</div>
|
|
<div class="code-box-meta markdown">
|
|
<div class="code-box-title">
|
|
<a href="#demo-simple">基本用法</a>
|
|
</div>
|
|
<p>简单的步骤条。</p>
|
|
<span class="collapse anticon anticon-circle-o-right" unselectable="none"></span>
|
|
</div>
|
|
</div><div class="code-box" id="demo-small-size">
|
|
<div class="code-box-demo">
|
|
<div id="components-steps-demo-small-size"></div>
|
|
<script>mountNode = document.getElementById('components-steps-demo-small-size');</script>
|
|
<script>(function(){'use strict';
|
|
|
|
var _antd = require('antd');
|
|
|
|
var Step = _antd.Steps.Step;
|
|
|
|
var steps = [{
|
|
status: 'finish',
|
|
title: '已完成'
|
|
}, {
|
|
status: 'process',
|
|
title: '进行中'
|
|
}, {
|
|
status: 'wait',
|
|
title: '待运行'
|
|
}, {
|
|
status: 'wait',
|
|
title: '待运行'
|
|
}].map(function (s, i) {
|
|
return React.createElement(Step, { key: i, title: s.title, description: s.description });
|
|
});
|
|
|
|
ReactDOM.render(React.createElement(
|
|
_antd.Steps,
|
|
{ size: 'small', current: 1 },
|
|
steps
|
|
), mountNode);})()</script><div class="highlight"><pre><code class="javascript"><span class="hljs-keyword">import</span> { Steps } <span class="hljs-keyword">from</span> <span class="hljs-string">'antd'</span>;
|
|
<span class="hljs-keyword">const</span> Step = Steps.Step;
|
|
|
|
<span class="hljs-keyword">const</span> steps = [{
|
|
status: <span class="hljs-string">'finish'</span>,
|
|
title: <span class="hljs-string">'已完成'</span>
|
|
}, {
|
|
status: <span class="hljs-string">'process'</span>,
|
|
title: <span class="hljs-string">'进行中'</span>
|
|
}, {
|
|
status: <span class="hljs-string">'wait'</span>,
|
|
title: <span class="hljs-string">'待运行'</span>
|
|
}, {
|
|
status: <span class="hljs-string">'wait'</span>,
|
|
title: <span class="hljs-string">'待运行'</span>
|
|
}].map((s, i) => <span class="xml"><span class="hljs-tag"><<span class="hljs-title">Step</span> <span class="hljs-attribute">key</span>=<span class="hljs-value">{i}</span> <span class="hljs-attribute">title</span>=<span class="hljs-value">{s.title}</span> <span class="hljs-attribute">description</span>=<span class="hljs-value">{s.description}</span> /></span>)</span>;
|
|
|
|
ReactDOM.render(<span class="xml"><span class="hljs-tag"><<span class="hljs-title">Steps</span> <span class="hljs-attribute">size</span>=<span class="hljs-value">"small"</span> <span class="hljs-attribute">current</span>=<span class="hljs-value">{1}</span>></span>{steps}<span class="hljs-tag"></<span class="hljs-title">Steps</span>></span>, mountNode);</span></code></pre></div>
|
|
</div>
|
|
<div class="code-box-meta markdown">
|
|
<div class="code-box-title">
|
|
<a href="#demo-small-size">迷你版</a>
|
|
</div>
|
|
<p>迷你版的步骤条,通过设置 <code><Steps size="small"></code> 启用.</p>
|
|
<span class="collapse anticon anticon-circle-o-right" unselectable="none"></span>
|
|
</div>
|
|
</div><div class="code-box" id="demo-icon">
|
|
<div class="code-box-demo">
|
|
<div id="components-steps-demo-icon"></div>
|
|
<script>mountNode = document.getElementById('components-steps-demo-icon');</script>
|
|
<script>(function(){"use strict";
|
|
|
|
var _antd = require("antd");
|
|
|
|
var Step = _antd.Steps.Step;
|
|
|
|
ReactDOM.render(React.createElement(
|
|
_antd.Steps,
|
|
null,
|
|
React.createElement(Step, { status: "finish", title: "步骤1", icon: "cloud" }),
|
|
React.createElement(Step, { status: "process", title: "步骤2", icon: "apple" }),
|
|
React.createElement(Step, { status: "wait", title: "步骤3", icon: "github" })
|
|
), mountNode);})()</script><div class="highlight"><pre><code class="javascript"><span class="hljs-keyword">import</span> { Steps } <span class="hljs-keyword">from</span> <span class="hljs-string">'antd'</span>;
|
|
<span class="hljs-keyword">const</span> Step = Steps.Step;
|
|
|
|
ReactDOM.render(<span class="xml"><span class="hljs-tag"><<span class="hljs-title">Steps</span>></span>
|
|
<span class="hljs-tag"><<span class="hljs-title">Step</span> <span class="hljs-attribute">status</span>=<span class="hljs-value">"finish"</span> <span class="hljs-attribute">title</span>=<span class="hljs-value">"步骤1"</span> <span class="hljs-attribute">icon</span>=<span class="hljs-value">"cloud"</span> /></span>
|
|
<span class="hljs-tag"><<span class="hljs-title">Step</span> <span class="hljs-attribute">status</span>=<span class="hljs-value">"process"</span> <span class="hljs-attribute">title</span>=<span class="hljs-value">"步骤2"</span> <span class="hljs-attribute">icon</span>=<span class="hljs-value">"apple"</span> /></span>
|
|
<span class="hljs-tag"><<span class="hljs-title">Step</span> <span class="hljs-attribute">status</span>=<span class="hljs-value">"wait"</span> <span class="hljs-attribute">title</span>=<span class="hljs-value">"步骤3"</span> <span class="hljs-attribute">icon</span>=<span class="hljs-value">"github"</span> /></span>
|
|
<span class="hljs-tag"></<span class="hljs-title">Steps</span>></span>, mountNode);</span></code></pre></div>
|
|
</div>
|
|
<div class="code-box-meta markdown">
|
|
<div class="code-box-title">
|
|
<a href="#demo-icon">带图标的步骤条</a>
|
|
</div>
|
|
<p>通过设置 <code>Steps.Step</code> 的 <code>icon</code> 属性,可以启用自定义图标。</p>
|
|
<span class="collapse anticon anticon-circle-o-right" unselectable="none"></span>
|
|
</div>
|
|
</div><div class="code-box" id="demo-step-next">
|
|
<div class="code-box-demo">
|
|
<div id="components-steps-demo-step-next"></div>
|
|
<script>mountNode = document.getElementById('components-steps-demo-step-next');</script>
|
|
<style type="text/css">#components-steps-demo-step-next > div > div {
|
|
margin-bottom: 30px;
|
|
}</style><div class="highlight"><pre><code class="css"><span class="hljs-id">#components-steps-demo-step-next</span> > <span class="hljs-tag">div</span> > <span class="hljs-tag">div</span> <span class="hljs-rules">{
|
|
<span class="hljs-rule"><span class="hljs-attribute">margin-bottom</span>:<span class="hljs-value"> <span class="hljs-number">30px</span></span></span>;
|
|
}</span></code></pre></div><script>(function(){'use strict';
|
|
|
|
var _antd = require('antd');
|
|
|
|
var Step = _antd.Steps.Step;
|
|
var array = Array.apply(null, Array(Math.floor(Math.random() * 3) + 3));
|
|
var steps = array.map(function (item, i) {
|
|
return {
|
|
title: '步骤' + (i + 1)
|
|
};
|
|
});
|
|
|
|
var App = React.createClass({
|
|
displayName: 'App',
|
|
getInitialState: function getInitialState() {
|
|
return {
|
|
currentStep: Math.floor(Math.random() * steps.length)
|
|
};
|
|
},
|
|
next: function next() {
|
|
var s = this.state.currentStep + 1;
|
|
if (s === steps.length) {
|
|
s = 0;
|
|
}
|
|
this.setState({
|
|
currentStep: s
|
|
});
|
|
},
|
|
render: function render() {
|
|
var cs = this.state.currentStep;
|
|
return React.createElement(
|
|
'div',
|
|
null,
|
|
React.createElement(
|
|
'div',
|
|
null,
|
|
'当前正在执行第 ',
|
|
cs + 1,
|
|
' 步'
|
|
),
|
|
React.createElement(
|
|
_antd.Steps,
|
|
{ current: cs },
|
|
steps.map(function (s, i) {
|
|
return React.createElement(Step, { key: i, title: s.title, description: s.description });
|
|
})
|
|
),
|
|
React.createElement(
|
|
'div',
|
|
null,
|
|
React.createElement(
|
|
_antd.Button,
|
|
{ onClick: this.next },
|
|
'下一步'
|
|
)
|
|
)
|
|
);
|
|
}
|
|
});
|
|
|
|
ReactDOM.render(React.createElement(App, null), mountNode);})()</script><div class="highlight"><pre><code class="javascript">import { Steps, Button } from 'antd';
|
|
const Step = Steps.Step;
|
|
const array = Array.apply(null, Array(Math.floor(Math.random() * 3) + 3));
|
|
const steps = array.map((item, i) => {
|
|
return {
|
|
title: `步骤${i + 1}`
|
|
};
|
|
});
|
|
|
|
const App = React.createClass({
|
|
getInitialState() {
|
|
return {
|
|
currentStep: Math.floor(Math.random() * steps.length)
|
|
};
|
|
},
|
|
next() {
|
|
let s = this.state.currentStep + 1;
|
|
if (s === steps.length) {
|
|
s = 0;
|
|
}
|
|
this.setState({
|
|
currentStep: s
|
|
});
|
|
},
|
|
render() {
|
|
const cs = this.state.currentStep;
|
|
return (
|
|
<div>
|
|
<div>当前正在执行第 {cs + 1} 步</div>
|
|
<Steps current={cs}>
|
|
{steps.map((s, i) => <Step key={i} title={s.title} description={s.description} />)}
|
|
</Steps>
|
|
<div>
|
|
<Button onClick={this.next}>下一步</Button>
|
|
</div>
|
|
</div>
|
|
);
|
|
}
|
|
});
|
|
|
|
ReactDOM.render(<App />, mountNode);</code></pre></div>
|
|
</div>
|
|
<div class="code-box-meta markdown">
|
|
<div class="code-box-title">
|
|
<a href="#demo-step-next">切换到下一步</a>
|
|
</div>
|
|
<p>随机生成 3~6 个步骤,初始随机进行到其中一个步骤。</p>
|
|
<span class="collapse anticon anticon-circle-o-right" unselectable="none"></span>
|
|
</div>
|
|
</div><div class="code-box" id="demo-vertical">
|
|
<div class="code-box-demo">
|
|
<div id="components-steps-demo-vertical"></div>
|
|
<script>mountNode = document.getElementById('components-steps-demo-vertical');</script>
|
|
<script>(function(){'use strict';
|
|
|
|
var _antd = require('antd');
|
|
|
|
var Step = _antd.Steps.Step;
|
|
|
|
var steps = [{
|
|
title: '已完成',
|
|
description: '这里是信息的描述'
|
|
}, {
|
|
title: '进行中',
|
|
description: '这里是信息的描述'
|
|
}, {
|
|
title: '待运行',
|
|
description: '这里是信息的描述'
|
|
}, {
|
|
title: '又一个待运行',
|
|
description: '这里是信息的描述'
|
|
}].map(function (s, i) {
|
|
return React.createElement(Step, { key: i, title: s.title, description: s.description });
|
|
});
|
|
|
|
ReactDOM.render(React.createElement(
|
|
_antd.Steps,
|
|
{ direction: 'vertical', current: 1 },
|
|
steps
|
|
), mountNode);})()</script><div class="highlight"><pre><code class="javascript"><span class="hljs-keyword">import</span> { Steps } <span class="hljs-keyword">from</span> <span class="hljs-string">'antd'</span>;
|
|
<span class="hljs-keyword">const</span> Step = Steps.Step;
|
|
|
|
<span class="hljs-keyword">const</span> steps = [{
|
|
title: <span class="hljs-string">'已完成'</span>,
|
|
description: <span class="hljs-string">'这里是信息的描述'</span>
|
|
}, {
|
|
title: <span class="hljs-string">'进行中'</span>,
|
|
description: <span class="hljs-string">'这里是信息的描述'</span>
|
|
}, {
|
|
title: <span class="hljs-string">'待运行'</span>,
|
|
description: <span class="hljs-string">'这里是信息的描述'</span>
|
|
}, {
|
|
title: <span class="hljs-string">'又一个待运行'</span>,
|
|
description: <span class="hljs-string">'这里是信息的描述'</span>
|
|
}].map((s, i) => <span class="xml"><span class="hljs-tag"><<span class="hljs-title">Step</span> <span class="hljs-attribute">key</span>=<span class="hljs-value">{i}</span> <span class="hljs-attribute">title</span>=<span class="hljs-value">{s.title}</span> <span class="hljs-attribute">description</span>=<span class="hljs-value">{s.description}</span> /></span>)</span>;
|
|
|
|
ReactDOM.render(<span class="xml"><span class="hljs-tag"><<span class="hljs-title">Steps</span> <span class="hljs-attribute">direction</span>=<span class="hljs-value">"vertical"</span> <span class="hljs-attribute">current</span>=<span class="hljs-value">{1}</span>></span>{steps}<span class="hljs-tag"></<span class="hljs-title">Steps</span>></span>,
|
|
mountNode);</span></code></pre></div>
|
|
</div>
|
|
<div class="code-box-meta markdown">
|
|
<div class="code-box-title">
|
|
<a href="#demo-vertical">竖直方向的步骤条</a>
|
|
</div>
|
|
<p>简单的竖直方向的步骤条。</p>
|
|
<span class="collapse anticon anticon-circle-o-right" unselectable="none"></span>
|
|
</div>
|
|
</div><div class="code-box" id="demo-vertical-small">
|
|
<div class="code-box-demo">
|
|
<div id="components-steps-demo-vertical-small"></div>
|
|
<script>mountNode = document.getElementById('components-steps-demo-vertical-small');</script>
|
|
<script>(function(){'use strict';
|
|
|
|
var _antd = require('antd');
|
|
|
|
var Step = _antd.Steps.Step;
|
|
|
|
var steps = [{
|
|
title: '已完成',
|
|
description: '这里是信息的描述'
|
|
}, {
|
|
title: '进行中',
|
|
description: '这里是信息的描述'
|
|
}, {
|
|
title: '待运行',
|
|
description: '这里是信息的描述'
|
|
}].map(function (s, i) {
|
|
return React.createElement(Step, { key: i, title: s.title, description: s.description });
|
|
});
|
|
|
|
ReactDOM.render(React.createElement(
|
|
_antd.Steps,
|
|
{ size: 'small', direction: 'vertical', current: 1 },
|
|
steps
|
|
), mountNode);})()</script><div class="highlight"><pre><code class="javascript"><span class="hljs-keyword">import</span> { Steps } <span class="hljs-keyword">from</span> <span class="hljs-string">'antd'</span>;
|
|
<span class="hljs-keyword">const</span> Step = Steps.Step;
|
|
|
|
<span class="hljs-keyword">const</span> steps = [{
|
|
title: <span class="hljs-string">'已完成'</span>,
|
|
description: <span class="hljs-string">'这里是信息的描述'</span>
|
|
}, {
|
|
title: <span class="hljs-string">'进行中'</span>,
|
|
description: <span class="hljs-string">'这里是信息的描述'</span>
|
|
}, {
|
|
title: <span class="hljs-string">'待运行'</span>,
|
|
description: <span class="hljs-string">'这里是信息的描述'</span>
|
|
}].map((s, i) => <span class="xml"><span class="hljs-tag"><<span class="hljs-title">Step</span> <span class="hljs-attribute">key</span>=<span class="hljs-value">{i}</span> <span class="hljs-attribute">title</span>=<span class="hljs-value">{s.title}</span> <span class="hljs-attribute">description</span>=<span class="hljs-value">{s.description}</span> /></span>)</span>;
|
|
|
|
ReactDOM.render(<span class="xml"><span class="hljs-tag"><<span class="hljs-title">Steps</span> <span class="hljs-attribute">size</span>=<span class="hljs-value">"small"</span> <span class="hljs-attribute">direction</span>=<span class="hljs-value">"vertical"</span> <span class="hljs-attribute">current</span>=<span class="hljs-value">{1}</span>></span>{steps}<span class="hljs-tag"></<span class="hljs-title">Steps</span>></span>,
|
|
mountNode);</span></code></pre></div>
|
|
</div>
|
|
<div class="code-box-meta markdown">
|
|
<div class="code-box-title">
|
|
<a href="#demo-vertical-small">竖直方向的小型步骤条</a>
|
|
</div>
|
|
<p>简单的竖直方向的小型步骤条。</p>
|
|
<span class="collapse anticon anticon-circle-o-right" unselectable="none"></span>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
</div>
|
|
<ul class="toc demos-anchor">
|
|
<li>
|
|
<a title="基本用法" href="#demo-simple">
|
|
<span>基本用法</span>
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a title="迷你版" href="#demo-small-size">
|
|
<span>迷你版</span>
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a title="带图标的步骤条" href="#demo-icon">
|
|
<span>带图标的步骤条</span>
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a title="切换到下一步" href="#demo-step-next">
|
|
<span>切换到下一步</span>
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a title="竖直方向的步骤条" href="#demo-vertical">
|
|
<span>竖直方向的步骤条</span>
|
|
</a>
|
|
</li>
|
|
<li>
|
|
<a title="竖直方向的小型步骤条" href="#demo-vertical-small">
|
|
<span>竖直方向的小型步骤条</span>
|
|
</a>
|
|
</li>
|
|
</ul>
|
|
<div class="api-container markdown"></div>
|
|
</section>
|
|
|
|
</div><footer id="footer">
|
|
<ul>
|
|
<li>
|
|
<h2>GitHub</h2>
|
|
<a target="_blank "href="https://github.com/ant-design/ant-design">仓库</a>
|
|
<a target="_blank" href="https://github.com/ant-design/antd-init">脚手架</a>
|
|
<a target="_blank" href="http://ant-tool.github.io/">开发工具</a>
|
|
</li>
|
|
<li>
|
|
<h2>关于我们</h2>
|
|
<a target="_blank" href="https://github.com/ant-ued/blog">博客 - Ant UED</a>
|
|
</li>
|
|
<li>
|
|
<h2>联系我们</h2>
|
|
<a target="_blank" href="https://github.com/ant-design/ant-design/issues">反馈和建议</a>
|
|
<a target="_blank" href="https://gitter.im/ant-design/ant-design">讨论</a>
|
|
<a target="_blank" href="http://dwz.cn/2AF9ao">报告 Bug</a>
|
|
</li>
|
|
<li>
|
|
<div>©2015 蚂蚁金服体验技术部出品</div>
|
|
<div>文档版本:<span id="versions-select"></span></div>
|
|
</li>
|
|
</ul>
|
|
</footer>
|
|
<script data-no-instant>
|
|
if (!location.port) {
|
|
(function(i,s,o,g,r,a,m){i['GoogleAnalyticsObject']=r;i[r]=i[r]||function(){
|
|
(i[r].q=i[r].q||[]).push(arguments)},i[r].l=1*new Date();a=s.createElement(o),
|
|
m=s.getElementsByTagName(o)[0];a.async=1;a.src=g;m.parentNode.insertBefore(a,m)
|
|
})(window,document,'script','//www.google-analytics.com/analytics.js','ga');
|
|
ga('create', 'UA-72788897-1', 'auto');
|
|
ga('send', 'pageview');
|
|
InstantClick.on('change', function() {
|
|
ga('send', 'pageview', location.pathname + location.search);
|
|
});
|
|
}
|
|
</script>
|
|
<script data-no-instant>
|
|
InstantClick.on('change', function() {
|
|
InstantClickChangeFns.forEach(function(fn) {
|
|
fn();
|
|
});
|
|
});
|
|
InstantClick.init();
|
|
</script>
|
|
</body>
|
|
</html> |