mirror of
https://github.com/wahyd4/ant-design.git
synced 2026-08-22 19:28:47 +10:00
782 lines
26 KiB
HTML
782 lines
26 KiB
HTML
<!DOCTYPE html>
|
||
<html>
|
||
<head>
|
||
<meta charset="utf-8">
|
||
<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="一个设计&前端框架"/>
|
||
<title>
|
||
Progress 进度条 - 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/antd-0.7.1.css">
|
||
<link rel="stylesheet" href="/static/style.css">
|
||
<link rel="stylesheet" href="/static/tomorrow.css">
|
||
<script>
|
||
(function (con) {
|
||
'use strict';
|
||
var prop, method;
|
||
var empty = {};
|
||
var dummy = function () {
|
||
};
|
||
var properties = 'memory'.split(',');
|
||
var methods = ('assert,clear,count,debug,dir,dirxml,error,exception,group,' +
|
||
'groupCollapsed,groupEnd,info,log,markTimeline,profile,profiles,profileEnd,' +
|
||
'show,table,time,timeEnd,timeline,timelineEnd,timeStamp,trace,warn').split(',');
|
||
while (prop = properties.pop()) {
|
||
con[prop] = con[prop] || empty;
|
||
}
|
||
while (method = methods.pop()) {
|
||
con[method] = con[method] || dummy;
|
||
}
|
||
})(this.console = this.console || {});
|
||
</script>
|
||
<script src="https://a.alipayobjects.com/??bluebird/2.9.30/bluebird.js,jquery/jquery/1.11.1/jquery.js,es5-shim/4.0.5/es5-shim-debug.js,es5-shim/4.0.5/es5-sham-debug.js,html5shiv/3.7.2/src/html5shiv.js,react/0.13.3/react.js,react-router/0.13.3/ReactRouter.js"></script>
|
||
<script>
|
||
var ANT_COMPONENTS = [];
|
||
ANT_COMPONENTS.push({
|
||
title: 'Layout',
|
||
desc: '布局'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Checkbox',
|
||
desc: '多选框'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Iconfont',
|
||
desc: '字体图标'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Button',
|
||
desc: '按钮'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Radio',
|
||
desc: '单选框'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Form',
|
||
desc: '表单'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Switch',
|
||
desc: '开关'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'InputNumber',
|
||
desc: '数字输入框'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Motion',
|
||
desc: '组件动画'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Slider',
|
||
desc: '滑动输入条'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Datepicker',
|
||
desc: '日期选择框'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Select',
|
||
desc: '选择器'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Tabs',
|
||
desc: '标签页'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Steps',
|
||
desc: '步骤条'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Breadcrumb',
|
||
desc: '面包屑'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Collapse',
|
||
desc: '折叠面板'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Alert',
|
||
desc: '通知栏'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Notification',
|
||
desc: '系统通知框'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Pagination',
|
||
desc: '分页'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Tree',
|
||
desc: '树形控件'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Carousel',
|
||
desc: '走马灯'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Menu',
|
||
desc: '导航菜单'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Tag',
|
||
desc: '标签'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Affix',
|
||
desc: '固定'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Upload',
|
||
desc: '文件上传'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Modal',
|
||
desc: '对话框'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Message',
|
||
desc: '全局提示'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Dropdown',
|
||
desc: '下拉菜单'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Popover',
|
||
desc: '气泡卡片'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Popconfirm',
|
||
desc: '气泡确认框'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Tooltip',
|
||
desc: '文字提示'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Progress',
|
||
desc: '进度条'
|
||
});
|
||
ANT_COMPONENTS.push({
|
||
title: 'Table',
|
||
desc: '表格'
|
||
});
|
||
</script>
|
||
<script src="/static/script.js"></script>
|
||
<script>
|
||
window.antdVersion = {
|
||
latest: '0.7.1',
|
||
stable: '0.7.0'
|
||
};
|
||
</script>
|
||
<script src="/dist/antd-0.7.1.js"></script>
|
||
<script src="/dist/demo.js"></script>
|
||
<script>
|
||
window.require = function (path) {
|
||
var result = window;
|
||
var namespaces = path.split('/');
|
||
namespaces.forEach(function (key, i) {
|
||
if (i !== 0 && i === namespaces.length - 1) {
|
||
key = capitalizeFirstLetter(key);
|
||
}
|
||
if (key !== 'lib') {
|
||
if (result[key]) {
|
||
result = result[key];
|
||
} else {
|
||
throw 'There should not have modules here 2.';
|
||
}
|
||
}
|
||
});
|
||
function capitalizeFirstLetter(string) {
|
||
return string.charAt(0).toUpperCase() + string.slice(1);
|
||
}
|
||
|
||
return result;
|
||
};
|
||
</script>
|
||
|
||
</head>
|
||
<body >
|
||
<header id="header">
|
||
<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">
|
||
<span class="bar"></span>
|
||
<ul>
|
||
<li class="">
|
||
<a href="/">首页</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="/docs/introduce">使用</a>
|
||
</li>
|
||
<li class="">
|
||
<a class="disabled" href="/design/">设计</a>
|
||
</li>
|
||
<li class="current">
|
||
<a href="/components">组件</a>
|
||
</li>
|
||
<li>
|
||
<a target="_blank" href="https://github.com/ant-design/ant-design">Github</a>
|
||
</li>
|
||
</ul>
|
||
</nav>
|
||
</header>
|
||
<div class="main-wrapper">
|
||
|
||
<aside class="aside-container">
|
||
<ul>
|
||
<li>
|
||
<h4>CSS</h4>
|
||
<ul class="">
|
||
<li class="">
|
||
<a href="../layout/">
|
||
Layout
|
||
<span class="chinese">布局</span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="../iconfont/">
|
||
Iconfont
|
||
<span class="chinese">字体图标</span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="../button/">
|
||
Button
|
||
<span class="chinese">按钮</span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="../form/">
|
||
Form
|
||
<span class="chinese">表单</span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="../motion/">
|
||
Motion
|
||
<span class="chinese">组件动画</span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="../alert/">
|
||
Alert
|
||
<span class="chinese">通知栏</span>
|
||
</a>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
<li>
|
||
<h4>Components</h4>
|
||
<ul class="aside-list-show">
|
||
<li class="">
|
||
<a href="../checkbox/">
|
||
Checkbox
|
||
<span class="chinese">多选框</span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="../radio/">
|
||
Radio
|
||
<span class="chinese">单选框</span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="../switch/">
|
||
Switch
|
||
<span class="chinese">开关</span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="../slider/">
|
||
Slider
|
||
<span class="chinese">滑动输入条</span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="../input-number/">
|
||
InputNumber
|
||
<span class="chinese">数字输入框</span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="../select/">
|
||
Select
|
||
<span class="chinese">选择器</span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="../datepicker/">
|
||
Datepicker
|
||
<span class="chinese">日期选择框</span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="../tabs/">
|
||
Tabs
|
||
<span class="chinese">标签页</span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="../steps/">
|
||
Steps
|
||
<span class="chinese">步骤条</span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="../breadcrumb/">
|
||
Breadcrumb
|
||
<span class="chinese">面包屑</span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="../collapse/">
|
||
Collapse
|
||
<span class="chinese">折叠面板</span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="../affix/">
|
||
Affix
|
||
<span class="chinese">固定</span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="../pagination/">
|
||
Pagination
|
||
<span class="chinese">分页</span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="../tree/">
|
||
Tree
|
||
<span class="chinese">树形控件</span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="../carousel/">
|
||
Carousel
|
||
<span class="chinese">走马灯</span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="../menu/">
|
||
Menu
|
||
<span class="chinese">导航菜单</span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="../tag/">
|
||
Tag
|
||
<span class="chinese">标签</span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="../upload/">
|
||
Upload
|
||
<span class="chinese">文件上传</span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="../notification/">
|
||
Notification
|
||
<span class="chinese">系统通知框</span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="../modal/">
|
||
Modal
|
||
<span class="chinese">对话框</span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="../message/">
|
||
Message
|
||
<span class="chinese">全局提示</span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="../dropdown/">
|
||
Dropdown
|
||
<span class="chinese">下拉菜单</span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="../popover/">
|
||
Popover
|
||
<span class="chinese">气泡卡片</span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="../popconfirm/">
|
||
Popconfirm
|
||
<span class="chinese">气泡确认框</span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="../tooltip/">
|
||
Tooltip
|
||
<span class="chinese">文字提示</span>
|
||
</a>
|
||
</li>
|
||
<li class="current">
|
||
<a href="./">
|
||
Progress
|
||
<span class="chinese">进度条</span>
|
||
</a>
|
||
</li>
|
||
<li class="">
|
||
<a href="../table/">
|
||
Table
|
||
<span class="chinese">表格</span>
|
||
</a>
|
||
</li>
|
||
</ul>
|
||
</li>
|
||
</ul>
|
||
</aside>
|
||
|
||
<section class="main-container">
|
||
<article class="markdown">
|
||
<h1>
|
||
Progress 进度条
|
||
</h1>
|
||
<p>展示操作的当前进度。</p>
|
||
<h2 id="何时使用">何时使用</h2><p>在操作需要较长时间才能完成时,为用户显示该操作的当前进度和状态。</p>
|
||
<ul>
|
||
<li>当一个操作会打断当前界面,或者需要在后台运行,且耗时可能超过2秒时;</li>
|
||
<li>当需要显示一个操作完成的百分比时。</li>
|
||
</ul>
|
||
<h2 id="api">API</h2><table>
|
||
<thead>
|
||
<tr>
|
||
<th>参数</th>
|
||
<th>说明</th>
|
||
<th>类型</th>
|
||
<th>默认值</th>
|
||
</tr>
|
||
</thead>
|
||
<tbody>
|
||
<tr>
|
||
<td>percent</td>
|
||
<td>百分比</td>
|
||
<td>number</td>
|
||
<td>0</td>
|
||
</tr>
|
||
<tr>
|
||
<td>status</td>
|
||
<td>状态,有两个值normal、exception</td>
|
||
<td>string</td>
|
||
<td>normal</td>
|
||
</tr>
|
||
<tr>
|
||
<td>strokeWidth</td>
|
||
<td>进度条线宽度,单位是进度条画布宽度的百分比</td>
|
||
<td>number</td>
|
||
<td>1</td>
|
||
</tr>
|
||
<tr>
|
||
<td>width</td>
|
||
<td>必填,进度条画布宽度,单位px。这里没有提供height属性设置,Line型高度就是strokeWidth,Circle型高度等于width</td>
|
||
<td>number</td>
|
||
<td>null</td>
|
||
</tr>
|
||
</tbody>
|
||
</table>
|
||
|
||
</article><h2 class="component-demos">
|
||
组件演示
|
||
<i class="iconfont-home icon-all" title="展开全部代码"></i>
|
||
</h2>
|
||
<div class="code-boxes clearfix">
|
||
<div class="code-boxes-col-2-1"><div class="code-box">
|
||
<div class="code-box-demo">
|
||
<div id="components-progress-demo-line"></div>
|
||
<script>(function(){"use strict";
|
||
|
||
var Progress = antd.Progress.Line;
|
||
|
||
React.render(React.createElement(
|
||
"div",
|
||
null,
|
||
React.createElement(Progress, { percent: "30" }),
|
||
React.createElement(Progress, { percent: "70", status: "exception" }),
|
||
React.createElement(Progress, { percent: "100" })
|
||
), document.getElementById('components-progress-demo-line'));})()</script><div class="highlight"><pre><code class="javascript"><span class="keyword">var</span> Progress = antd.Progress.Line;
|
||
|
||
React.render(
|
||
<span class="xml"><span class="tag"><<span class="title">div</span>></span>
|
||
<span class="tag"><<span class="title">Progress</span> <span class="attribute">percent</span>=<span class="value">"30"</span> /></span>
|
||
<span class="tag"><<span class="title">Progress</span> <span class="attribute">percent</span>=<span class="value">"70"</span> <span class="attribute">status</span>=<span class="value">"exception"</span> /></span>
|
||
<span class="tag"><<span class="title">Progress</span> <span class="attribute">percent</span>=<span class="value">"100"</span> /></span>
|
||
<span class="tag"></<span class="title">div</span>></span>
|
||
, document.getElementById('components-progress-demo-line'));</span></code></pre></div>
|
||
</div>
|
||
<div class="code-box-meta markdown">
|
||
<div class="code-box-title">进度条</div>
|
||
<p>标准的进度条。</p>
|
||
<span class="collapse anticon anticon-circle-o-right"></span>
|
||
</div>
|
||
</div><div class="code-box">
|
||
<div class="code-box-demo">
|
||
<div id="components-progress-demo-line-mini"></div>
|
||
<script>(function(){"use strict";
|
||
|
||
var Progress = antd.Progress.Line;
|
||
|
||
React.render(React.createElement(
|
||
"div",
|
||
null,
|
||
React.createElement(Progress, { percent: "30", width: "170", strokeWidth: "3" }),
|
||
React.createElement(Progress, { percent: "70", width: "170", strokeWidth: "3", status: "exception" }),
|
||
React.createElement(Progress, { percent: "100", width: "170", strokeWidth: "3" })
|
||
), document.getElementById('components-progress-demo-line-mini'));})()</script><div class="highlight"><pre><code class="javascript"><span class="keyword">var</span> Progress = antd.Progress.Line;
|
||
|
||
React.render(
|
||
<span class="xml"><span class="tag"><<span class="title">div</span>></span>
|
||
<span class="tag"><<span class="title">Progress</span> <span class="attribute">percent</span>=<span class="value">"30"</span> <span class="attribute">width</span>=<span class="value">"170"</span> <span class="attribute">strokeWidth</span>=<span class="value">"3"</span> /></span>
|
||
<span class="tag"><<span class="title">Progress</span> <span class="attribute">percent</span>=<span class="value">"70"</span> <span class="attribute">width</span>=<span class="value">"170"</span> <span class="attribute">strokeWidth</span>=<span class="value">"3"</span> <span class="attribute">status</span>=<span class="value">"exception"</span> /></span>
|
||
<span class="tag"><<span class="title">Progress</span> <span class="attribute">percent</span>=<span class="value">"100"</span> <span class="attribute">width</span>=<span class="value">"170"</span> <span class="attribute">strokeWidth</span>=<span class="value">"3"</span> /></span>
|
||
<span class="tag"></<span class="title">div</span>></span>
|
||
, document.getElementById('components-progress-demo-line-mini'));</span></code></pre></div>
|
||
</div>
|
||
<div class="code-box-meta markdown">
|
||
<div class="code-box-title">小型进度条</div>
|
||
<p>适合放在较狭窄的区域内。</p>
|
||
<span class="collapse anticon anticon-circle-o-right"></span>
|
||
</div>
|
||
</div><div class="code-box">
|
||
<div class="code-box-demo">
|
||
<div id="components-progress-demo-circle-dynamic"></div>
|
||
<script>(function(){'use strict';
|
||
|
||
var ProgressCircle = antd.Progress.Circle;
|
||
|
||
var MyProgress = React.createClass({
|
||
displayName: 'MyProgress',
|
||
|
||
getInitialState: function getInitialState() {
|
||
return {
|
||
percent: 0
|
||
};
|
||
},
|
||
componentDidMount: function componentDidMount() {
|
||
var self = this;
|
||
setInterval(function () {
|
||
if (self.state.percent < 100) {
|
||
self.state.percent += 4;
|
||
}
|
||
self.setState({
|
||
percent: self.state.percent
|
||
});
|
||
}, 200);
|
||
},
|
||
render: function render() {
|
||
return React.createElement(ProgressCircle, { percent: this.state.percent });
|
||
}
|
||
});
|
||
|
||
React.render(React.createElement(MyProgress, null), document.getElementById('components-progress-demo-circle-dynamic'));})()</script><div class="highlight"><pre><code class="javascript"><span class="keyword">var</span> ProgressCircle = antd.Progress.Circle;
|
||
|
||
<span class="keyword">var</span> MyProgress = React.createClass({
|
||
getInitialState() {
|
||
<span class="keyword">return</span> {
|
||
percent: <span class="number">0</span>
|
||
};
|
||
},
|
||
componentDidMount: <span class="function"><span class="keyword">function</span><span class="params">()</span> {</span>
|
||
<span class="keyword">var</span> self = <span class="keyword">this</span>;
|
||
setInterval(<span class="function"><span class="keyword">function</span><span class="params">()</span> {</span>
|
||
<span class="keyword">if</span> (self.state.percent < <span class="number">100</span>) {
|
||
self.state.percent += <span class="number">4</span>;
|
||
}
|
||
self.setState({
|
||
percent: self.state.percent
|
||
});
|
||
}, <span class="number">200</span>);
|
||
},
|
||
render() {
|
||
<span class="keyword">return</span> <span class="xml"><span class="tag"><<span class="title">ProgressCircle</span> <span class="attribute">percent</span>=<span class="value">{this.state.percent}</span> /></span>;</span>
|
||
}
|
||
});
|
||
|
||
React.render(
|
||
<span class="xml"><span class="tag"><<span class="title">MyProgress</span> /></span>
|
||
, document.getElementById('components-progress-demo-circle-dynamic'));</span></code></pre></div>
|
||
</div>
|
||
<div class="code-box-meta markdown">
|
||
<div class="code-box-title">进度圈动态展示</div>
|
||
<p>会动的进度条才是好进度条。</p>
|
||
<span class="collapse anticon anticon-circle-o-right"></span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
<div class="code-boxes-col-2-1"><div class="code-box">
|
||
<div class="code-box-demo">
|
||
<div id="components-progress-demo-circle"></div>
|
||
<script>(function(){"use strict";
|
||
|
||
var ProgressCircle = antd.Progress.Circle;
|
||
|
||
React.render(React.createElement(
|
||
"div",
|
||
null,
|
||
React.createElement(ProgressCircle, { percent: "30" }),
|
||
React.createElement(ProgressCircle, { percent: "70", status: "exception" }),
|
||
React.createElement(ProgressCircle, { percent: "100" })
|
||
), document.getElementById('components-progress-demo-circle'));})()</script><div class="highlight"><pre><code class="javascript"><span class="keyword">var</span> ProgressCircle = antd.Progress.Circle;
|
||
|
||
React.render(
|
||
<span class="xml"><span class="tag"><<span class="title">div</span>></span>
|
||
<span class="tag"><<span class="title">ProgressCircle</span> <span class="attribute">percent</span>=<span class="value">"30"</span> /></span>
|
||
<span class="tag"><<span class="title">ProgressCircle</span> <span class="attribute">percent</span>=<span class="value">"70"</span> <span class="attribute">status</span>=<span class="value">"exception"</span> /></span>
|
||
<span class="tag"><<span class="title">ProgressCircle</span> <span class="attribute">percent</span>=<span class="value">"100"</span> /></span>
|
||
<span class="tag"></<span class="title">div</span>></span>
|
||
, document.getElementById('components-progress-demo-circle'));</span></code></pre></div><style>
|
||
.ant-progress-circle-wrap,
|
||
.ant-progress-line-wrap {
|
||
margin-right: 8px;
|
||
margin-bottom: 5px;
|
||
}
|
||
</style>
|
||
|
||
</div>
|
||
<div class="code-box-meta markdown">
|
||
<div class="code-box-title">进度圈</div>
|
||
<p>圈形的进度。</p>
|
||
<span class="collapse anticon anticon-circle-o-right"></span>
|
||
</div>
|
||
</div><div class="code-box">
|
||
<div class="code-box-demo">
|
||
<div id="components-progress-demo-circle-mini"></div>
|
||
<script>(function(){"use strict";
|
||
|
||
var ProgressCircle = antd.Progress.Circle;
|
||
|
||
React.render(React.createElement(
|
||
"div",
|
||
null,
|
||
React.createElement(ProgressCircle, { percent: "30", width: "80" }),
|
||
React.createElement(ProgressCircle, { percent: "70", width: "80", status: "exception" }),
|
||
React.createElement(ProgressCircle, { percent: "100", width: "80" })
|
||
), document.getElementById('components-progress-demo-circle-mini'));})()</script><div class="highlight"><pre><code class="javascript"><span class="keyword">var</span> ProgressCircle = antd.Progress.Circle;
|
||
|
||
React.render(
|
||
<span class="xml"><span class="tag"><<span class="title">div</span>></span>
|
||
<span class="tag"><<span class="title">ProgressCircle</span> <span class="attribute">percent</span>=<span class="value">"30"</span> <span class="attribute">width</span>=<span class="value">"80"</span> /></span>
|
||
<span class="tag"><<span class="title">ProgressCircle</span> <span class="attribute">percent</span>=<span class="value">"70"</span> <span class="attribute">width</span>=<span class="value">"80"</span> <span class="attribute">status</span>=<span class="value">"exception"</span> /></span>
|
||
<span class="tag"><<span class="title">ProgressCircle</span> <span class="attribute">percent</span>=<span class="value">"100"</span> <span class="attribute">width</span>=<span class="value">"80"</span> /></span>
|
||
<span class="tag"></<span class="title">div</span>></span>
|
||
, document.getElementById('components-progress-demo-circle-mini'));</span></code></pre></div>
|
||
</div>
|
||
<div class="code-box-meta markdown">
|
||
<div class="code-box-title">小型进度圈</div>
|
||
<p>小一号的圈形进度。</p>
|
||
<span class="collapse anticon anticon-circle-o-right"></span>
|
||
</div>
|
||
</div><div class="code-box">
|
||
<div class="code-box-demo">
|
||
<div id="components-progress-demo-dynamic"></div>
|
||
<script>(function(){'use strict';
|
||
|
||
var Progress = antd.Progress.Line;
|
||
|
||
var MyProgress = React.createClass({
|
||
displayName: 'MyProgress',
|
||
|
||
getInitialState: function getInitialState() {
|
||
return {
|
||
percent: 0
|
||
};
|
||
},
|
||
componentDidMount: function componentDidMount() {
|
||
var self = this;
|
||
setInterval(function () {
|
||
if (self.state.percent < 100) {
|
||
self.state.percent += 4;
|
||
}
|
||
self.setState({
|
||
percent: self.state.percent
|
||
});
|
||
}, 200);
|
||
},
|
||
render: function render() {
|
||
return React.createElement(Progress, { percent: this.state.percent });
|
||
}
|
||
});
|
||
|
||
React.render(React.createElement(MyProgress, null), document.getElementById('components-progress-demo-dynamic'));})()</script><div class="highlight"><pre><code class="javascript"><span class="keyword">var</span> Progress = antd.Progress.Line;
|
||
|
||
<span class="keyword">var</span> MyProgress = React.createClass({
|
||
getInitialState() {
|
||
<span class="keyword">return</span> {
|
||
percent: <span class="number">0</span>
|
||
};
|
||
},
|
||
componentDidMount: <span class="function"><span class="keyword">function</span><span class="params">()</span> {</span>
|
||
<span class="keyword">var</span> self = <span class="keyword">this</span>;
|
||
setInterval(<span class="function"><span class="keyword">function</span><span class="params">()</span> {</span>
|
||
<span class="keyword">if</span> (self.state.percent < <span class="number">100</span>) {
|
||
self.state.percent += <span class="number">4</span>;
|
||
}
|
||
self.setState({
|
||
percent: self.state.percent
|
||
});
|
||
}, <span class="number">200</span>);
|
||
},
|
||
render() {
|
||
<span class="keyword">return</span> <span class="xml"><span class="tag"><<span class="title">Progress</span> <span class="attribute">percent</span>=<span class="value">{this.state.percent}</span> /></span>;</span>
|
||
}
|
||
});
|
||
|
||
React.render(
|
||
<span class="xml"><span class="tag"><<span class="title">MyProgress</span> /></span>
|
||
, document.getElementById('components-progress-demo-dynamic'));</span></code></pre></div>
|
||
</div>
|
||
<div class="code-box-meta markdown">
|
||
<div class="code-box-title">动态展示</div>
|
||
<p>会动的进度条才是好进度条。</p>
|
||
<span class="collapse anticon anticon-circle-o-right"></span>
|
||
</div>
|
||
</div>
|
||
</div>
|
||
</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/ant-design/tree/master/style">样式</a>
|
||
<a target="_blank" href="https://github.com/ant-design/antd-bin">开发工具</a>
|
||
</li>
|
||
<li>
|
||
<h2>关于我们</h2>
|
||
<a href="http://www.atatech.org/teams/79">博客 - Ant UED</a>
|
||
</li>
|
||
<li>
|
||
<h2>联系我们</h2>
|
||
<a target="_blank" href="https://github.com/ant-design/ant-design/issues">问题与建议 - Issues</a>
|
||
</li>
|
||
<li>
|
||
<h3>©2015 蚂蚁金服体验技术部出品</h3>
|
||
</li>
|
||
</ul>
|
||
</footer>
|
||
</body>
|
||
</html> |