Files
ant-design/docs/react/practical-projects.html
T
2016-12-13 14:40:06 +08:00

177 lines
56 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="description" content="An enterprise-class UI design language and React-based implementation">
<meta name="description" content="A set of high-quality React components">
<meta name="description" content="One of best React UI library for enterprise background">
<title>Ant Design - One Design Language</title>
<link rel="icon" href="https://t.alipayobjects.com/images/T1QUBfXo4fXXXXXXXX.png" type="image/x-icon">
<link rel="stylesheet" type="text/css" href="https://fonts.googleapis.cnpmjs.org/css?family=Lato:400,700|Raleway"/>
<link rel="stylesheet" type="text/css" href="/index-1.css"/>
<link rel="stylesheet" type="text/css" href="/index-2.css"/>
<style id="nprogress-style">
#nprogress { display: none }
</style>
<!--[if lte IE 10]>
<script
src="https://as.alipayobjects.com/g/component/??console-polyfill/0.2.2/index.js,media-match/2.0.2/media.match.min.js"></script>
<![endif]-->
<script>
if (!window.Intl) {
document.writeln('<script src="https://as.alipayobjects.com/g/component/intl/1.0.1/??Intl.js,locale-data/jsonp/en.js,locale-data/jsonp/zh.js">' + '<' + '/script>');
}
if (!window.Promise) {
document.writeln('<script src="https://as.alipayobjects.com/g/component/es6-promise/3.2.2/es6-promise.min.js"' + '>' + '<' + '/' + 'script>');
}
</script>
</head>
<body>
<div id="react-content">
<div class="page-wrapper" data-reactroot="" data-reactid="1" data-react-checksum="1550509587"><header id="header" class="clearfix" data-reactid="2"><div class="ant-row" data-reactid="3"><div class="ant-col-xs-24 ant-col-sm-24 ant-col-md-6 ant-col-lg-4" data-reactid="4"><a id="logo" href="/" data-reactid="5"><img alt="logo" src="https://t.alipayobjects.com/images/rmsweb/T1B9hfXcdvXXXXXXXX.svg" data-reactid="6"/><span data-reactid="7">Ant Design</span></a></div><div style="display:block;" class="ant-col-xs-0 ant-col-sm-17 ant-col-md-18 ant-col-lg-20" data-reactid="8"><div id="search-box" data-reactid="9"><div class="ant-select ant-select-combobox ant-select-enabled" data-reactid="10"><div class="ant-select-selection
ant-select-selection--single" role="combobox" aria-autocomplete="list" aria-haspopup="true" aria-expanded="false" data-reactid="11"><div class="ant-select-selection__rendered" data-reactid="12"><div style="display:block;user-select:none;-webkit-user-select:none;" unselectable="unselectable" class="ant-select-selection__placeholder" data-reactid="13">Search Components...</div><ul data-reactid="14"><li class="ant-select-search ant-select-search--inline" data-reactid="15"><div class="ant-select-search__field__wrap" data-reactid="16"><input value="" class="ant-select-search__field" data-reactid="17"/><span class="ant-select-search__field__mirror" data-reactid="18"></span></div></li></ul></div><span class="ant-select-arrow" style="user-select:none;-webkit-user-select:none;" unselectable="unselectable" data-reactid="19"><b data-reactid="20"></b></span></div></div></div><button type="button" class="ant-btn ant-btn-ghost ant-btn-sm lang" data-reactid="21"><span data-reactid="22">中文</span></button><ul class="ant-menu ant-menu-horizontal ant-menu-light ant-menu-root" role="menu" aria-activedescendant="" id="nav" tabindex="0" data-reactid="23"><li class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="24"><a href="/" data-reactid="25"><span data-reactid="26">Home</span></a></li><li class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="27"><a href="/docs/spec/introduce" data-reactid="28"><span data-reactid="29">Specification</span></a></li><li class="ant-menu-item-selected ant-menu-item" role="menuitem" aria-selected="true" data-reactid="30"><a href="/docs/react/introduce" data-reactid="31"><span data-reactid="32">Components</span></a></li><li class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="33"><a href="/docs/pattern/navigation" data-reactid="34"><span data-reactid="35">Pattern</span></a></li><li class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="36"><a href="/docs/practice/cases" data-reactid="37"><span data-reactid="38">Practice</span></a></li><li class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="39"><a href="/docs/resource/download" data-reactid="40"><span data-reactid="41">Resource</span></a></li></ul></div></div></header><div class="main-wrapper" data-reactid="42"><div class="ant-row" data-reactid="43"><div class="ant-col-xs-24 ant-col-sm-24 ant-col-md-6 ant-col-lg-4" data-reactid="44"><ul class="ant-menu ant-menu-inline aside-container ant-menu-light ant-menu-root" role="menu" aria-activedescendant="" tabindex="0" data-reactid="45"><li style="padding-left:24px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="46"><a href="/docs/react/introduce" data-reactid="47">Ant Design of React</a></li><li style="padding-left:24px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="48"><a href="/docs/react/getting-started" data-reactid="49">Getting Started</a></li><li style="padding-left:24px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="50"><a href="/docs/react/install" data-reactid="51">Installation</a></li><li style="padding-left:24px;" class="ant-menu-item-selected ant-menu-item" role="menuitem" aria-selected="true" data-reactid="52"><a href="/docs/react/practical-projects" data-reactid="53">Practical Projects</a></li><li style="padding-left:24px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="54"><a href="/docs/react/customize-theme" data-reactid="55">Customize Theme</a></li><li style="padding-left:24px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="56"><a href="//github.com/ant-design/intl-example" target="_blank" rel="noopener noreferrer" data-reactid="57">i18n Solution</a></li><li style="padding-left:24px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="58"><a href="/changelog" data-reactid="59">Change Log</a></li><li class="ant-menu-submenu-inline ant-menu-submenu-open ant-menu-submenu" data-reactid="60"><div style="padding-left:24px;" class="ant-menu-submenu-title" aria-open="true" aria-owns="1481611172218_10" aria-haspopup="true" data-reactid="61"><h4 data-reactid="62">Components</h4></div><ul class="ant-menu ant-menu-inline ant-menu-sub" role="menu" aria-activedescendant="" id="1481611172218_10" data-reactid="63"><li class=" ant-menu-item-group" data-reactid="64"><div class="ant-menu-item-group-title" data-reactid="65">General</div><ul class="ant-menu-item-group-list" data-reactid="66"><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="67"><a href="/components/button/" data-reactid="68"><span data-reactid="69">Button</span><span class="chinese" data-reactid="70"></span></a></li><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="71"><a href="/components/icon/" data-reactid="72"><span data-reactid="73">Icon</span><span class="chinese" data-reactid="74"></span></a></li></ul></li><li class=" ant-menu-item-group" data-reactid="75"><div class="ant-menu-item-group-title" data-reactid="76">Layout</div><ul class="ant-menu-item-group-list" data-reactid="77"><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="78"><a href="/components/grid/" data-reactid="79"><span data-reactid="80">Grid</span><span class="chinese" data-reactid="81"></span></a></li></ul></li><li class=" ant-menu-item-group" data-reactid="82"><div class="ant-menu-item-group-title" data-reactid="83">Navigation</div><ul class="ant-menu-item-group-list" data-reactid="84"><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="85"><a href="/components/affix/" data-reactid="86"><span data-reactid="87">Affix</span><span class="chinese" data-reactid="88"></span></a></li><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="89"><a href="/components/anchor/" data-reactid="90"><span data-reactid="91">Anchor</span><span class="chinese" data-reactid="92"></span></a></li><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="93"><a href="/components/back-top/" data-reactid="94"><span data-reactid="95">BackTop</span><span class="chinese" data-reactid="96"></span></a></li><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="97"><a href="/components/breadcrumb/" data-reactid="98"><span data-reactid="99">Breadcrumb</span><span class="chinese" data-reactid="100"></span></a></li><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="101"><a href="/components/dropdown/" data-reactid="102"><span data-reactid="103">Dropdown</span><span class="chinese" data-reactid="104"></span></a></li><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="105"><a href="/components/menu/" data-reactid="106"><span data-reactid="107">Menu</span><span class="chinese" data-reactid="108"></span></a></li><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="109"><a href="/components/pagination/" data-reactid="110"><span data-reactid="111">Pagination</span><span class="chinese" data-reactid="112"></span></a></li><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="113"><a href="/components/steps/" data-reactid="114"><span data-reactid="115">Steps</span><span class="chinese" data-reactid="116"></span></a></li><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="117"><a href="/components/tabs/" data-reactid="118"><span data-reactid="119">Tabs</span><span class="chinese" data-reactid="120"></span></a></li></ul></li><li class=" ant-menu-item-group" data-reactid="121"><div class="ant-menu-item-group-title" data-reactid="122">Data Entry</div><ul class="ant-menu-item-group-list" data-reactid="123"><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="124"><a href="/components/auto-complete/" data-reactid="125"><span data-reactid="126">AutoComplete</span><span class="chinese" data-reactid="127"></span></a></li><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="128"><a href="/components/checkbox/" data-reactid="129"><span data-reactid="130">Checkbox</span><span class="chinese" data-reactid="131"></span></a></li><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="132"><a href="/components/cascader/" data-reactid="133"><span data-reactid="134">Cascader</span><span class="chinese" data-reactid="135"></span></a></li><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="136"><a href="/components/date-picker/" data-reactid="137"><span data-reactid="138">DatePicker</span><span class="chinese" data-reactid="139"></span></a></li><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="140"><a href="/components/form/" data-reactid="141"><span data-reactid="142">Form</span><span class="chinese" data-reactid="143"></span></a></li><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="144"><a href="/components/input/" data-reactid="145"><span data-reactid="146">Input</span><span class="chinese" data-reactid="147"></span></a></li><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="148"><a href="/components/input-number/" data-reactid="149"><span data-reactid="150">InputNumber</span><span class="chinese" data-reactid="151"></span></a></li><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="152"><a href="/components/mention/" data-reactid="153"><span data-reactid="154">Mention</span><span class="chinese" data-reactid="155"></span></a></li><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="156"><a href="/components/radio/" data-reactid="157"><span data-reactid="158">Radio</span><span class="chinese" data-reactid="159"></span></a></li><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="160"><a href="/components/rate/" data-reactid="161"><span data-reactid="162">Rate</span><span class="chinese" data-reactid="163"></span></a></li><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="164"><a href="/components/select/" data-reactid="165"><span data-reactid="166">Select</span><span class="chinese" data-reactid="167"></span></a></li><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="168"><a href="/components/slider/" data-reactid="169"><span data-reactid="170">Slider</span><span class="chinese" data-reactid="171"></span></a></li><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="172"><a href="/components/switch/" data-reactid="173"><span data-reactid="174">Switch</span><span class="chinese" data-reactid="175"></span></a></li><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="176"><a href="/components/time-picker/" data-reactid="177"><span data-reactid="178">TimePicker</span><span class="chinese" data-reactid="179"></span></a></li><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="180"><a href="/components/transfer/" data-reactid="181"><span data-reactid="182">Transfer</span><span class="chinese" data-reactid="183"></span></a></li><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="184"><a href="/components/tree-select/" data-reactid="185"><span data-reactid="186">TreeSelect</span><span class="chinese" data-reactid="187"></span></a></li><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="188"><a href="/components/upload/" data-reactid="189"><span data-reactid="190">Upload</span><span class="chinese" data-reactid="191"></span></a></li></ul></li><li class=" ant-menu-item-group" data-reactid="192"><div class="ant-menu-item-group-title" data-reactid="193">Data Display</div><ul class="ant-menu-item-group-list" data-reactid="194"><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="195"><a href="/components/badge/" data-reactid="196"><span data-reactid="197">Badge</span><span class="chinese" data-reactid="198"></span></a></li><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="199"><a href="/components/card/" data-reactid="200"><span data-reactid="201">Card</span><span class="chinese" data-reactid="202"></span></a></li><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="203"><a href="/components/carousel/" data-reactid="204"><span data-reactid="205">Carousel</span><span class="chinese" data-reactid="206"></span></a></li><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="207"><a href="/components/collapse/" data-reactid="208"><span data-reactid="209">Collapse</span><span class="chinese" data-reactid="210"></span></a></li><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="211"><a href="/components/calendar/" data-reactid="212"><span data-reactid="213">Calendar</span><span class="chinese" data-reactid="214"></span></a></li><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="215"><a href="/components/popover/" data-reactid="216"><span data-reactid="217">Popover</span><span class="chinese" data-reactid="218"></span></a></li><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="219"><a href="/components/table/" data-reactid="220"><span data-reactid="221">Table</span><span class="chinese" data-reactid="222"></span></a></li><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="223"><a href="/components/tag/" data-reactid="224"><span data-reactid="225">Tag</span><span class="chinese" data-reactid="226"></span></a></li><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="227"><a href="/components/timeline/" data-reactid="228"><span data-reactid="229">Timeline</span><span class="chinese" data-reactid="230"></span></a></li><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="231"><a href="/components/tooltip/" data-reactid="232"><span data-reactid="233">Tooltip</span><span class="chinese" data-reactid="234"></span></a></li><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="235"><a href="/components/tree/" data-reactid="236"><span data-reactid="237">Tree</span><span class="chinese" data-reactid="238"></span></a></li></ul></li><li class=" ant-menu-item-group" data-reactid="239"><div class="ant-menu-item-group-title" data-reactid="240">Feedback</div><ul class="ant-menu-item-group-list" data-reactid="241"><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="242"><a href="/components/alert/" data-reactid="243"><span data-reactid="244">Alert</span><span class="chinese" data-reactid="245"></span></a></li><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="246"><a href="/components/message/" data-reactid="247"><span data-reactid="248">Message</span><span class="chinese" data-reactid="249"></span></a></li><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="250"><a href="/components/modal/" data-reactid="251"><span data-reactid="252">Modal</span><span class="chinese" data-reactid="253"></span></a></li><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="254"><a href="/components/notification/" data-reactid="255"><span data-reactid="256">Notification</span><span class="chinese" data-reactid="257"></span></a></li><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="258"><a href="/components/popconfirm/" data-reactid="259"><span data-reactid="260">Popconfirm</span><span class="chinese" data-reactid="261"></span></a></li><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="262"><a href="/components/progress/" data-reactid="263"><span data-reactid="264">Progress</span><span class="chinese" data-reactid="265"></span></a></li><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="266"><a href="/components/spin/" data-reactid="267"><span data-reactid="268">Spin</span><span class="chinese" data-reactid="269"></span></a></li></ul></li><li class=" ant-menu-item-group" data-reactid="270"><div class="ant-menu-item-group-title" data-reactid="271">Other</div><ul class="ant-menu-item-group-list" data-reactid="272"><li style="padding-left:48px;" class="ant-menu-item" role="menuitem" aria-selected="false" data-reactid="273"><a href="/components/locale-provider/" data-reactid="274"><span data-reactid="275">LocaleProvider</span><span class="chinese" data-reactid="276"></span></a></li></ul></li></ul></li></ul></div><div class="main-container ant-col-xs-24 ant-col-sm-24 ant-col-md-18 ant-col-lg-20" data-reactid="277"><article class="markdown" data-reactid="278"><h1 data-reactid="279"><!-- react-text: 280 -->Practical Projects<!-- /react-text --><a class="edit-button" href="https://github.com/ant-design/ant-design/blob/master/docs/react/practical-projects.en-US.md" data-reactid="281"><i class="anticon anticon-edit" data-reactid="282"></i></a></h1><section class="markdown" data-reactid="283"><p data-reactid="284"><a href="https://github.com/dvajs/dva" data-reactid="285"><!-- react-text: 286 -->dva<!-- /react-text --></a><!-- react-text: 287 --> is a React and redux based, lightweight and elm-style framework, which supports side effects, hot module replacement, dynamic on demand, react-native, SSR. And it has been widely used in production environment.<!-- /react-text --></p><p data-reactid="288"><!-- react-text: 289 -->This article will guide you to create a simple application from zero using dva and antd.<!-- /react-text --></p><p data-reactid="290"><!-- react-text: 291 -->Include the following:<!-- /react-text --></p></section><section class="toc" data-reactid="292"><ul data-reactid="293"><li data-reactid="294"><a class="bisheng-toc-h2" href="#Install-dva" data-reactid="295"><!-- react-text: 296 -->Install dva<!-- /react-text --></a></li><li data-reactid="297"><a class="bisheng-toc-h2" href="#Create-New-App" data-reactid="298"><!-- react-text: 299 -->Create New App<!-- /react-text --></a></li><li data-reactid="300"><a class="bisheng-toc-h2" href="#Integrate-antd" data-reactid="301"><!-- react-text: 302 -->Integrate antd<!-- /react-text --></a></li><li data-reactid="303"><a class="bisheng-toc-h2" href="#Define-Router" data-reactid="304"><!-- react-text: 305 -->Define Router<!-- /react-text --></a></li><li data-reactid="306"><a class="bisheng-toc-h2" href="#Write-UI-Components" data-reactid="307"><!-- react-text: 308 -->Write UI Components<!-- /react-text --></a></li><li data-reactid="309"><a class="bisheng-toc-h2" href="#Define-Model" data-reactid="310"><!-- react-text: 311 -->Define Model<!-- /react-text --></a></li><li data-reactid="312"><a class="bisheng-toc-h2" href="#Connect" data-reactid="313"><!-- react-text: 314 -->Connect<!-- /react-text --></a></li><li data-reactid="315"><a class="bisheng-toc-h2" href="#Build" data-reactid="316"><!-- react-text: 317 -->Build<!-- /react-text --></a></li><li data-reactid="318"><a class="bisheng-toc-h2" href="#What&#x27;s-Next" data-reactid="319"><!-- react-text: 320 -->What&#x27;s Next<!-- /react-text --></a></li></ul></section><section class="markdown" data-reactid="321"><h2 id="Install-dva" data-reactid="322"><span data-reactid="323"><!-- react-text: 324 -->Install dva<!-- /react-text --></span><a href="#Install-dva" class="anchor" data-reactid="325">#</a></h2><p data-reactid="326"><!-- react-text: 327 -->Install dva with npm.<!-- /react-text --></p><pre class="language-bash" data-reactid="328"><code data-reactid="329">$ <span class="token function">npm</span> <span class="token function">install</span> dva-cli -g</code></pre><h2 id="Create-New-App" data-reactid="330"><span data-reactid="331"><!-- react-text: 332 -->Create New App<!-- /react-text --></span><a href="#Create-New-App" class="anchor" data-reactid="333">#</a></h2><p data-reactid="334"><!-- react-text: 335 -->After installed dva-cli, you can have access to the <!-- /react-text --><code data-reactid="336"><!-- react-text: 337 -->dva<!-- /react-text --></code><!-- react-text: 338 --> command in terminal. Now, create a new application with <!-- /react-text --><code data-reactid="339"><!-- react-text: 340 -->dva new<!-- /react-text --></code><!-- react-text: 341 -->.<!-- /react-text --></p><pre class="language-bash" data-reactid="342"><code data-reactid="343">$ dva new dva-quickstart</code></pre><p data-reactid="344"><!-- react-text: 345 -->This creates <!-- /react-text --><code data-reactid="346"><!-- react-text: 347 -->dva-quickstart<!-- /react-text --></code><!-- react-text: 348 --> directory, that contains the project directories and files, and provides development server, build script, mock service, proxy server and so on.<!-- /react-text --></p><p data-reactid="349"><!-- react-text: 350 -->Then <!-- /react-text --><code data-reactid="351"><!-- react-text: 352 -->cd<!-- /react-text --></code><!-- react-text: 353 --> the <!-- /react-text --><code data-reactid="354"><!-- react-text: 355 -->dva-quickstart<!-- /react-text --></code><!-- react-text: 356 --> directory, and start the development server.<!-- /react-text --></p><pre class="language-bash" data-reactid="357"><code data-reactid="358">$ <span class="token function">cd</span> dva-quickstart
$ <span class="token function">npm</span> start</code></pre><p data-reactid="359"><!-- react-text: 360 -->After a few seconds, you will see the following output:<!-- /react-text --></p><pre class="language-bash" data-reactid="361"><code data-reactid="362"> proxy: load rule from proxy.config.js
proxy: listened on 8989
📦 411/411 build modules
webpack: bundle build is now finished.</code></pre><p data-reactid="363"><!-- react-text: 364 -->Open <!-- /react-text --><a href="http://localhost:8989" data-reactid="365"><!-- react-text: 366 -->http://localhost:8989<!-- /react-text --></a><!-- react-text: 367 --> in your browser, you will see dva welcome page.<!-- /react-text --></p><h2 id="Integrate-antd" data-reactid="368"><span data-reactid="369"><!-- react-text: 370 -->Integrate antd<!-- /react-text --></span><a href="#Integrate-antd" class="anchor" data-reactid="371">#</a></h2><p data-reactid="372"><!-- react-text: 373 -->Install <!-- /react-text --><code data-reactid="374"><!-- react-text: 375 -->antd<!-- /react-text --></code><!-- react-text: 376 --> and <!-- /react-text --><code data-reactid="377"><!-- react-text: 378 -->babel-plugin-import<!-- /react-text --></code><!-- react-text: 379 --> with npm. <!-- /react-text --><code data-reactid="380"><!-- react-text: 381 -->babel-plugin-import<!-- /react-text --></code><!-- react-text: 382 --> is used to automatically import scripts and stylesheets from antd in demand. See <!-- /react-text --><a href="https://github.com/ant-design/babel-plugin-import" data-reactid="383"><!-- react-text: 384 -->repo<!-- /react-text --></a><!-- react-text: 385 --><!-- /react-text --></p><pre class="language-bash" data-reactid="386"><code data-reactid="387">$ <span class="token function">npm</span> <span class="token function">install</span> antd babel-plugin-import --save</code></pre><p data-reactid="388"><!-- react-text: 389 -->Edit <!-- /react-text --><code data-reactid="390"><!-- react-text: 391 -->webpack.config.js<!-- /react-text --></code><!-- react-text: 392 --> to integrate <!-- /react-text --><code data-reactid="393"><!-- react-text: 394 -->babel-plugin-import<!-- /react-text --></code><!-- react-text: 395 -->.<!-- /react-text --></p><pre class="language-diff" data-reactid="396"><code data-reactid="397"><span class="token inserted">+ webpackConfig.babel.plugins.push(['import', {</span>
<span class="token inserted">+ libraryName: 'antd',</span>
<span class="token inserted">+ style: 'css',</span>
<span class="token inserted">+ }]);</span></code></pre><blockquote data-reactid="398"><p data-reactid="399"><!-- react-text: 400 -->Notice: No need to manually restart the server, it will restart automatically after you save the <!-- /react-text --><code data-reactid="401"><!-- react-text: 402 -->webpack.config.js<!-- /react-text --></code><!-- react-text: 403 -->.<!-- /react-text --></p></blockquote><h2 id="Define-Router" data-reactid="404"><span data-reactid="405"><!-- react-text: 406 -->Define Router<!-- /react-text --></span><a href="#Define-Router" class="anchor" data-reactid="407">#</a></h2><p data-reactid="408"><!-- react-text: 409 -->We need to write an application displaying the list of products. The first step is to create a route.<!-- /react-text --></p><p data-reactid="410"><!-- react-text: 411 -->Create a route component <!-- /react-text --><code data-reactid="412"><!-- react-text: 413 -->routes/Products.js<!-- /react-text --></code><!-- react-text: 414 -->:<!-- /react-text --></p><pre class="language-javascript" data-reactid="415"><code data-reactid="416"><span class="token keyword">import</span> React <span class="token keyword">from</span> <span class="token string">'react'</span><span class="token punctuation">;</span>
<span class="token keyword">const</span> Products <span class="token operator">=</span> <span class="token punctuation">(</span>props<span class="token punctuation">)</span> <span class="token operator">=</span><span class="token operator">></span> <span class="token punctuation">(</span>
<span class="token operator">&lt;</span>h2<span class="token operator">></span>List <span class="token keyword">of</span> Products<span class="token operator">&lt;</span><span class="token operator">/</span>h2<span class="token operator">></span>
<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token keyword">export</span> <span class="token keyword">default</span> Products<span class="token punctuation">;</span></code></pre><p data-reactid="417"><!-- react-text: 418 -->Add routing information to router, edit <!-- /react-text --><code data-reactid="419"><!-- react-text: 420 -->router.js<!-- /react-text --></code><!-- react-text: 421 -->:<!-- /react-text --></p><pre class="language-diff" data-reactid="422"><code data-reactid="423"><span class="token inserted">+ import Products from './routes/Products';</span>
...
<span class="token inserted">+ &lt;Route path="/products" component={Products} /></span></code></pre><p data-reactid="424"><!-- react-text: 425 -->Then open <!-- /react-text --><a href="http://localhost:8989/#/products" data-reactid="426"><!-- react-text: 427 -->http://localhost:8989/#/products<!-- /react-text --></a><!-- react-text: 428 --> in your browser, you should be able to see the <!-- /react-text --><code data-reactid="429"><!-- react-text: 430 -->&lt;h2&gt;<!-- /react-text --></code><!-- react-text: 431 --> tag defined before.<!-- /react-text --></p><h2 id="Write-UI-Components" data-reactid="432"><span data-reactid="433"><!-- react-text: 434 -->Write UI Components<!-- /react-text --></span><a href="#Write-UI-Components" class="anchor" data-reactid="435">#</a></h2><p data-reactid="436"><!-- react-text: 437 -->As your application grows and you notice you are sharing UI elements between multiple pages (or using them multiple times on the same page), in dva it&#x27;s called reusable components.<!-- /react-text --></p><p data-reactid="438"><!-- react-text: 439 -->Let&#x27;s create a <!-- /react-text --><code data-reactid="440"><!-- react-text: 441 -->ProductList<!-- /react-text --></code><!-- react-text: 442 --> component that we can use in multiple places to show a list of products.<!-- /react-text --></p><p data-reactid="443"><!-- react-text: 444 -->Create <!-- /react-text --><code data-reactid="445"><!-- react-text: 446 -->components/ProductList.js<!-- /react-text --></code><!-- react-text: 447 --> and typing:<!-- /react-text --></p><pre class="language-javascript" data-reactid="448"><code data-reactid="449"><span class="token keyword">import</span> React<span class="token punctuation">,</span> <span class="token punctuation">{</span> PropTypes <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'react'</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token punctuation">{</span> Table<span class="token punctuation">,</span> Popconfirm<span class="token punctuation">,</span> Button <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'antd'</span><span class="token punctuation">;</span>
<span class="token keyword">const</span> ProductList <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token punctuation">{</span> onDelete<span class="token punctuation">,</span> products <span class="token punctuation">}</span><span class="token punctuation">)</span> <span class="token operator">=</span><span class="token operator">></span> <span class="token punctuation">{</span>
<span class="token keyword">const</span> columns <span class="token operator">=</span> <span class="token punctuation">[</span><span class="token punctuation">{</span>
title<span class="token punctuation">:</span> <span class="token string">'Name'</span><span class="token punctuation">,</span>
dataIndex<span class="token punctuation">:</span> <span class="token string">'name'</span><span class="token punctuation">,</span>
<span class="token punctuation">}</span><span class="token punctuation">,</span> <span class="token punctuation">{</span>
title<span class="token punctuation">:</span> <span class="token string">'Actions'</span><span class="token punctuation">,</span>
render<span class="token punctuation">:</span> <span class="token punctuation">(</span>text<span class="token punctuation">,</span> record<span class="token punctuation">)</span> <span class="token operator">=</span><span class="token operator">></span> <span class="token punctuation">{</span>
<span class="token keyword">return</span> <span class="token punctuation">(</span>
<span class="token operator">&lt;</span>Popconfirm title<span class="token operator">=</span><span class="token string">"Delete?"</span> onConfirm<span class="token operator">=</span><span class="token punctuation">{</span><span class="token punctuation">(</span><span class="token punctuation">)</span> <span class="token operator">=</span><span class="token operator">></span> <span class="token function">onDelete</span><span class="token punctuation">(</span>record<span class="token punctuation">.</span>id<span class="token punctuation">)</span><span class="token punctuation">}</span><span class="token operator">></span>
<span class="token operator">&lt;</span>Button<span class="token operator">></span>Delete<span class="token operator">&lt;</span><span class="token operator">/</span>Button<span class="token operator">></span>
<span class="token operator">&lt;</span><span class="token operator">/</span>Popconfirm<span class="token operator">></span>
<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span><span class="token punctuation">,</span>
<span class="token punctuation">}</span><span class="token punctuation">]</span><span class="token punctuation">;</span>
<span class="token keyword">return</span> <span class="token punctuation">(</span>
<span class="token operator">&lt;</span>Table
dataSource<span class="token operator">=</span><span class="token punctuation">{</span>products<span class="token punctuation">}</span>
columns<span class="token operator">=</span><span class="token punctuation">{</span>columns<span class="token punctuation">}</span>
<span class="token operator">/</span><span class="token operator">></span>
<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span>
ProductList<span class="token punctuation">.</span>proptypes <span class="token operator">=</span> <span class="token punctuation">{</span>
onDelete<span class="token punctuation">:</span> PropTypes<span class="token punctuation">.</span>func<span class="token punctuation">.</span>isRequired<span class="token punctuation">,</span>
products<span class="token punctuation">:</span> PropTypes<span class="token punctuation">.</span>array<span class="token punctuation">.</span>isRequired<span class="token punctuation">,</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span>
<span class="token keyword">export</span> <span class="token keyword">default</span> ProductList<span class="token punctuation">;</span></code></pre><h2 id="Define-Model" data-reactid="450"><span data-reactid="451"><!-- react-text: 452 -->Define Model<!-- /react-text --></span><a href="#Define-Model" class="anchor" data-reactid="453">#</a></h2><p data-reactid="454"><!-- react-text: 455 -->After complete the UI, we will begin processing the data and logic.<!-- /react-text --></p><p data-reactid="456"><!-- react-text: 457 -->dva manages domain model with <!-- /react-text --><code data-reactid="458"><!-- react-text: 459 -->model<!-- /react-text --></code><!-- react-text: 460 -->, with reducers for synchronous state update, effects for async logic, and subscriptions for data source subscribe.<!-- /react-text --></p><p data-reactid="461"><!-- react-text: 462 -->Let&#x27;s create a model <!-- /react-text --><code data-reactid="463"><!-- react-text: 464 -->models/products.js<!-- /react-text --></code><!-- react-text: 465 --> and typing:<!-- /react-text --></p><pre class="language-javascript" data-reactid="466"><code data-reactid="467"><span class="token keyword">import</span> dva <span class="token keyword">from</span> <span class="token string">'dva'</span><span class="token punctuation">;</span>
<span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token punctuation">{</span>
namespace<span class="token punctuation">:</span> <span class="token string">'products'</span><span class="token punctuation">,</span>
state<span class="token punctuation">:</span> <span class="token punctuation">[</span><span class="token punctuation">]</span><span class="token punctuation">,</span>
reducers<span class="token punctuation">:</span> <span class="token punctuation">{</span>
<span class="token string">'delete'</span><span class="token punctuation">(</span>state<span class="token punctuation">,</span> <span class="token punctuation">{</span> payload<span class="token punctuation">:</span> id <span class="token punctuation">}</span><span class="token punctuation">)</span> <span class="token punctuation">{</span>
<span class="token keyword">return</span> state<span class="token punctuation">.</span><span class="token function">filter</span><span class="token punctuation">(</span>item <span class="token operator">=</span><span class="token operator">></span> item<span class="token punctuation">.</span>id <span class="token operator">!==</span> id<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span><span class="token punctuation">,</span>
<span class="token punctuation">}</span><span class="token punctuation">,</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span></code></pre><p data-reactid="468"><!-- react-text: 469 -->In this model:<!-- /react-text --></p><ul data-reactid="470"><li data-reactid="471"><p data-reactid="472"><code data-reactid="473"><!-- react-text: 474 -->namespace<!-- /react-text --></code><!-- react-text: 475 --> represent the key on global state<!-- /react-text --></p></li><li data-reactid="476"><p data-reactid="477"><code data-reactid="478"><!-- react-text: 479 -->state<!-- /react-text --></code><!-- react-text: 480 --> is the initial value, here is an empty array<!-- /react-text --></p></li><li data-reactid="481"><p data-reactid="482"><code data-reactid="483"><!-- react-text: 484 -->reducers<!-- /react-text --></code><!-- react-text: 485 --> is equal to reducer in redux, accepting action, and update state synchronously<!-- /react-text --></p></li></ul><p data-reactid="486"><!-- react-text: 487 -->Then don&#x27;t forget to require it in <!-- /react-text --><code data-reactid="488"><!-- react-text: 489 -->index.js<!-- /react-text --></code><!-- react-text: 490 -->:<!-- /react-text --></p><pre class="language-diff" data-reactid="491"><code data-reactid="492">// 3. Model
<span class="token inserted">+ app.model(require('./models/products'));</span></code></pre><h2 id="Connect" data-reactid="493"><span data-reactid="494"><!-- react-text: 495 -->Connect<!-- /react-text --></span><a href="#Connect" class="anchor" data-reactid="496">#</a></h2><p data-reactid="497"><!-- react-text: 498 -->So far, we have completed a separate model and component. Then how to connect these together?<!-- /react-text --></p><p data-reactid="499"><!-- react-text: 500 -->dva provides a <!-- /react-text --><code data-reactid="501"><!-- react-text: 502 -->connect<!-- /react-text --></code><!-- react-text: 503 --> method. If you are familiar with redux, this <!-- /react-text --><code data-reactid="504"><!-- react-text: 505 -->connect<!-- /react-text --></code><!-- react-text: 506 --> is from react-router.<!-- /react-text --></p><p data-reactid="507"><!-- react-text: 508 -->Edit <!-- /react-text --><code data-reactid="509"><!-- react-text: 510 -->routes/Products.js<!-- /react-text --></code><!-- react-text: 511 --> and replace with following:<!-- /react-text --></p><pre class="language-javascript" data-reactid="512"><code data-reactid="513"><span class="token keyword">import</span> React <span class="token keyword">from</span> <span class="token string">'react'</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> <span class="token punctuation">{</span> connect <span class="token punctuation">}</span> <span class="token keyword">from</span> <span class="token string">'dva'</span><span class="token punctuation">;</span>
<span class="token keyword">import</span> ProductList <span class="token keyword">from</span> <span class="token string">'../components/ProductList'</span><span class="token punctuation">;</span>
<span class="token keyword">const</span> Products <span class="token operator">=</span> <span class="token punctuation">(</span><span class="token punctuation">{</span> dispatch<span class="token punctuation">,</span> products <span class="token punctuation">}</span><span class="token punctuation">)</span> <span class="token operator">=</span><span class="token operator">></span> <span class="token punctuation">{</span>
<span class="token keyword">function</span> <span class="token function">handleDelete</span><span class="token punctuation">(</span>id<span class="token punctuation">)</span> <span class="token punctuation">{</span>
<span class="token function">dispatch</span><span class="token punctuation">(</span><span class="token punctuation">{</span>
type<span class="token punctuation">:</span> <span class="token string">'products/delete'</span><span class="token punctuation">,</span>
payload<span class="token punctuation">:</span> id<span class="token punctuation">,</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span>
<span class="token keyword">return</span> <span class="token punctuation">(</span>
<span class="token operator">&lt;</span>div<span class="token operator">></span>
<span class="token operator">&lt;</span>h2<span class="token operator">></span>List <span class="token keyword">of</span> Products<span class="token operator">&lt;</span><span class="token operator">/</span>h2<span class="token operator">></span>
<span class="token operator">&lt;</span>ProductList onDelete<span class="token operator">=</span><span class="token punctuation">{</span>handleDelete<span class="token punctuation">}</span> products<span class="token operator">=</span><span class="token punctuation">{</span>products<span class="token punctuation">}</span> <span class="token operator">/</span><span class="token operator">></span>
<span class="token operator">&lt;</span><span class="token operator">/</span>div<span class="token operator">></span>
<span class="token punctuation">)</span><span class="token punctuation">;</span>
<span class="token punctuation">}</span><span class="token punctuation">;</span>
<span class="token comment" spellcheck="true">// export default Products;</span>
<span class="token keyword">export</span> <span class="token keyword">default</span> <span class="token function">connect</span><span class="token punctuation">(</span><span class="token punctuation">(</span><span class="token punctuation">{</span> products <span class="token punctuation">}</span><span class="token punctuation">)</span> <span class="token operator">=</span><span class="token operator">></span> <span class="token punctuation">(</span><span class="token punctuation">{</span>
products<span class="token punctuation">,</span>
<span class="token punctuation">}</span><span class="token punctuation">)</span><span class="token punctuation">)</span><span class="token punctuation">(</span>Products<span class="token punctuation">)</span><span class="token punctuation">;</span></code></pre><p data-reactid="514"><!-- react-text: 515 -->Finally, we need some initial data to make the application run together. Edit <!-- /react-text --><code data-reactid="516"><!-- react-text: 517 -->index.js<!-- /react-text --></code><!-- react-text: 518 -->:<!-- /react-text --></p><pre class="language-diff" data-reactid="519"><code data-reactid="520"><span class="token deleted">- const app = dva();</span>
<span class="token inserted">+ const app = dva({</span>
<span class="token inserted">+ initialState: {</span>
<span class="token inserted">+ products: [</span>
<span class="token inserted">+ { name: 'dva', id: 1 },</span>
<span class="token inserted">+ { name: 'antd', id: 2 },</span>
<span class="token inserted">+ ],</span>
<span class="token inserted">+ },</span>
<span class="token inserted">+ });</span></code></pre><p data-reactid="521"><!-- react-text: 522 -->Refresh your browser, you should see the following result:<!-- /react-text --></p><p style="text-align:center;" data-reactid="523"><img src="https://zos.alipayobjects.com/rmsportal/GQJeDDeUCSTRMMg.gif" data-reactid="524"/></p><h2 id="Build" data-reactid="525"><span data-reactid="526"><!-- react-text: 527 -->Build<!-- /react-text --></span><a href="#Build" class="anchor" data-reactid="528">#</a></h2><p data-reactid="529"><!-- react-text: 530 -->Now that we&#x27;ve written our application and verified that it works in development, it&#x27;s time to get it ready to deploy to our users. To do so, run the following command:<!-- /react-text --></p><pre class="language-bash" data-reactid="531"><code data-reactid="532">$ <span class="token function">npm</span> run build</code></pre><p data-reactid="533"><!-- react-text: 534 -->After a few seconds, the output should be as follows:<!-- /react-text --></p><pre class="language-bash" data-reactid="535"><code data-reactid="536">Child
Time: 14008ms
Asset Size Chunks Chunk Names
index.html 255 bytes <span class="token punctuation">[</span>emitted<span class="token punctuation">]</span>
common.js 1.18 kB 0 <span class="token punctuation">[</span>emitted<span class="token punctuation">]</span> common
index.js 504 kB 1, 0 <span class="token punctuation">[</span>emitted<span class="token punctuation">]</span> index
index.css 127 kB 1, 0 <span class="token punctuation">[</span>emitted<span class="token punctuation">]</span> index</code></pre><p data-reactid="537"><!-- react-text: 538 -->The <!-- /react-text --><code data-reactid="539"><!-- react-text: 540 -->build<!-- /react-text --></code><!-- react-text: 541 --> command packages up all of the assets that make up your application —— JavaScript, templates, CSS, web fonts, images, and more. Then you can find these files in the <!-- /react-text --><code data-reactid="542"><!-- react-text: 543 -->dist /<!-- /react-text --></code><!-- react-text: 544 --> directory.<!-- /react-text --></p><h2 id="What&#x27;s-Next" data-reactid="545"><span data-reactid="546"><!-- react-text: 547 -->What&#x27;s Next<!-- /react-text --></span><a href="#What&#x27;s-Next" class="anchor" data-reactid="548">#</a></h2><p data-reactid="549"><!-- react-text: 550 -->We have completed a simple application, but you may still have lots of questions, such as:<!-- /react-text --></p><ul data-reactid="551"><li data-reactid="552"><p data-reactid="553"><!-- react-text: 554 -->How to dealing with async logic<!-- /react-text --></p></li><li data-reactid="555"><p data-reactid="556"><!-- react-text: 557 -->How to load initial data elegantly<!-- /react-text --></p></li><li data-reactid="558"><p data-reactid="559"><!-- react-text: 560 -->How to handle onError globally and locally<!-- /react-text --></p></li><li data-reactid="561"><p data-reactid="562"><!-- react-text: 563 -->How to load Routes and Models on demand<!-- /react-text --></p></li><li data-reactid="564"><p data-reactid="565"><!-- react-text: 566 -->How to implement HMR<!-- /react-text --></p></li><li data-reactid="567"><p data-reactid="568"><!-- react-text: 569 -->How to mock data<!-- /react-text --></p></li><li data-reactid="570"><p data-reactid="571"><!-- react-text: 572 -->and so on...<!-- /react-text --></p></li></ul><p data-reactid="573"><!-- react-text: 574 -->You can:<!-- /react-text --></p><ul data-reactid="575"><li data-reactid="576"><p data-reactid="577"><!-- react-text: 578 -->Visit <!-- /react-text --><a href="https://github.com/dvajs/dva" data-reactid="579"><!-- react-text: 580 -->dva official website<!-- /react-text --></a><!-- react-text: 581 -->.<!-- /react-text --></p></li><li data-reactid="582"><p data-reactid="583"><!-- react-text: 584 -->View all the <!-- /react-text --><a href="https://github.com/dvajs/dva#api" data-reactid="585"><!-- react-text: 586 -->API<!-- /react-text --></a><!-- react-text: 587 -->.<!-- /react-text --></p></li><li data-reactid="588"><p data-reactid="589"><!-- react-text: 590 -->View <!-- /react-text --><a href="https://github.com/dvajs/dva-docs/blob/master/v1/zh-cn/tutorial/01-%E6%A6%82%E8%A6%81.md" data-reactid="591"><!-- react-text: 592 -->tutorial<!-- /react-text --></a><!-- react-text: 593 -->, complete a medium application step by step.<!-- /react-text --></p></li><li data-reactid="594"><p data-reactid="595"><!-- react-text: 596 -->View examples, such as <!-- /react-text --><a href="https://github.com/dvajs/dva-hackernews" data-reactid="597"><!-- react-text: 598 -->dva version of hackernews<!-- /react-text --></a><!-- react-text: 599 -->.<!-- /react-text --></p></li></ul></section></article></div></div><div class="ant-row" data-reactid="600"><div class="ant-col-xs-24 ant-col-sm-24 ant-col-md-18 ant-col-md-offset-6 ant-col-lg-20 ant-col-lg-offset-4" data-reactid="601"><section class="prev-next-nav" data-reactid="602"><a class="prev-page" href="/docs/react/install" data-reactid="603">Installation</a><a class="next-page" href="/docs/react/customize-theme" data-reactid="604">Customize Theme</a></section></div></div></div><footer id="footer" data-reactid="605"><ul data-reactid="606"><li data-reactid="607"><h2 data-reactid="608">GitHub</h2><div data-reactid="609"><a target="_blank " href="https://github.com/ant-design/ant-design" data-reactid="610"><span data-reactid="611">Repository</span></a></div><div data-reactid="612"><a target="_blank" rel="noopener noreferrer" href="https://github.com/dvajs/dva" data-reactid="613">dva</a><!-- react-text: 614 --> - <!-- /react-text --><span data-reactid="615">Framework</span></div><div data-reactid="616"><a target="_blank" rel="noopener noreferrer" href="https://github.com/dvajs/dva-cli" data-reactid="617">dva-cli</a><!-- react-text: 618 --> -<!-- /react-text --><span data-reactid="619">Scaffold</span></div><div data-reactid="620"><a target="_blank" rel="noopener noreferrer" href="http://ant-tool.github.io" data-reactid="621">ant-tool</a><!-- react-text: 622 --> - <!-- /react-text --><span data-reactid="623">Developer Tools</span></div></li><li data-reactid="624"><h2 data-reactid="625"><span data-reactid="626">Links</span></h2><div data-reactid="627"><a href="http://mobile.ant.design" data-reactid="628">Ant Design Mobile</a><span data-reactid="629"> - </span><span data-reactid="630">Mobile</span></div><div data-reactid="631"><a href="https://g2.alipay.com/" data-reactid="632">G2</a><span data-reactid="633"> - </span><span data-reactid="634">Data Visualization</span></div><div data-reactid="635"><a href="https://antv.alipay.com/" data-reactid="636">AntV</a><span data-reactid="637"> - </span><span data-reactid="638">Data Visualization Specification</span></div><div data-reactid="639"><a href="http://motion.ant.design" data-reactid="640">Ant Motion</a><span data-reactid="641"> - </span><span data-reactid="642">Motion</span></div><div data-reactid="643"><a href="http://library.ant.design/" data-reactid="644">AntD Library</a><span data-reactid="645"> - </span><span data-reactid="646">Axure library of Ant Design</span></div><div data-reactid="647"><a href="http://ux.ant.design" data-reactid="648">Ant UX</a><span data-reactid="649"> - </span><span data-reactid="650">Sitemap Template</span></div></li><li data-reactid="651"><h2 data-reactid="652"><span data-reactid="653">Community</span></h2><div data-reactid="654"><a rel="noopener noreferrer" href="/changelog" data-reactid="655"><span data-reactid="656">Change Log</span></a></div><div data-reactid="657"><a target="_blank" rel="noopener noreferrer" href="https://github.com/ant-design/ant-design/issues" data-reactid="658"><span data-reactid="659">Feedback</span></a></div><div data-reactid="660"><a target="_blank" rel="noopener noreferrer" href="https://gitter.im/ant-design/ant-design" data-reactid="661"><span data-reactid="662">Chat Room</span></a></div><div data-reactid="663"><a target="_blank" rel="noopener noreferrer" href="https://github.com/ant-design/ant-design/issues/new" data-reactid="664"><span data-reactid="665">Bug Report</span></a></div></li><li data-reactid="666"><div data-reactid="667"><!-- react-text: 668 -->©2016 <!-- /react-text --><span data-reactid="669">Created by Ant UED</span></div><div data-reactid="670"><!-- react-text: 671 -->Powered by <!-- /react-text --><a href="https://github.com/benjycui/bisheng" data-reactid="672">BiSheng</a></div><div style="margin-top:10px;" data-reactid="673"><span data-reactid="674">Version: </span><div class="ant-select-sm ant-select ant-select-enabled" data-reactid="675"><div class="ant-select-selection
ant-select-selection--single" role="combobox" aria-autocomplete="list" aria-haspopup="true" aria-expanded="false" tabindex="0" data-reactid="676"><div class="ant-select-selection__rendered" data-reactid="677"><div class="ant-select-selection-selected-value" title="1.11.4" style="display:block;opacity:1;" data-reactid="678">1.11.4</div></div><span class="ant-select-arrow" style="user-select:none;-webkit-user-select:none;" unselectable="unselectable" data-reactid="679"><b data-reactid="680"></b></span></div></div></div></li></ul></footer></div>
</div>
<script>
function isZhCN(pathname) {
return /-cn\/?$/.test(pathname);
}
function getLocalizedPathname(path, zhCN) {
var pathname = path.startsWith('/') ? path : '/' + path;
if (!zhCN) { // to enUS
return /\/?index-cn/.test(pathname) ? '/' : pathname.replace('-cn', '');
} else if (pathname === '/') {
return '/index-cn';
} else if (pathname.endsWith('/')) {
return pathname.replace(/\/$/, '-cn/');
}
return pathname + '-cn';
}
var queryString = location.search;
if (queryString) {
var pathname = location.pathname;
var isZhCNConfig = queryString.indexOf('zh-CN') > -1;
if (isZhCNConfig !== isZhCN(pathname)) {
location.pathname = getLocalizedPathname(pathname, isZhCNConfig)
}
}
</script>
<script>
// Enable Google Analytics
if (!location.port) {
/* eslint-disable */
(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');
/* eslint-enable */
}
</script>
<script src="/common.js"></script>
<script src="/index.js"></script>
</body>
</html>