mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-25 11:40:04 +08:00
Merge branch 'master' into develop-0.11.0
This commit is contained in:
commit
5e8aa0cafd
@ -1,5 +1,6 @@
|
||||
import React, { createElement } from 'react';
|
||||
import assign from 'object-assign';
|
||||
import { isCssAnimationSupported } from 'css-animation';
|
||||
|
||||
function getNumberArray(num) {
|
||||
return num ?
|
||||
@ -98,7 +99,8 @@ class AntScrollNumber extends React.Component {
|
||||
const props = assign({}, this.props, {
|
||||
className: `${this.props.prefixCls} ${this.props.className}`
|
||||
});
|
||||
if (typeof document !== 'undefined' && typeof window !== 'undefined') {
|
||||
const isBrowser = (typeof document !== 'undefined' && typeof window !== 'undefined');
|
||||
if (isBrowser && isCssAnimationSupported) {
|
||||
return createElement(
|
||||
this.props.component,
|
||||
props,
|
||||
|
@ -19,7 +19,7 @@ ReactDOM.render(<div>
|
||||
<div>
|
||||
<RadioGroup onChange={onChange} defaultValue="a">
|
||||
<RadioButton value="a">杭州</RadioButton>
|
||||
<RadioButton value="b">上海</RadioButton>
|
||||
<RadioButton value="b" disabled>上海</RadioButton>
|
||||
<RadioButton value="c">北京</RadioButton>
|
||||
<RadioButton value="d">成都</RadioButton>
|
||||
</RadioGroup>
|
||||
|
@ -42,7 +42,7 @@ export default React.createClass({
|
||||
{...radio.props}
|
||||
onChange={this.onRadioChange}
|
||||
checked={this.state.value === radio.props.value}
|
||||
disabled={this.props.disabled}
|
||||
disabled={radio.props.disabled || this.props.disabled}
|
||||
/>;
|
||||
}
|
||||
return radio;
|
||||
|
@ -102,3 +102,19 @@ var dataSource = new Table.DataSource({
|
||||
| resolve | 获得数据的解析函数,接收参数为远程数据返回的 result | Function | | |
|
||||
| getPagination | 和后台接口返回的分页数据进行适配的函数,返回值会传给表格中的分页器 | Function | | |
|
||||
| getParams | 和后台接口接收的参数进行适配,返回值会作为请求的参数发送 | Function | | 无 |
|
||||
|
||||
## 注意
|
||||
|
||||
按照 React 的[规范](http://facebook.github.io/react/docs/multiple-components.html#dynamic-children),所有的组件数组必须绑定 key。在 Table 中,默认将每列数据的 `key` 属性作为唯一的标识。
|
||||
|
||||
如果你的数据没有这个属性,务必使用 `rowKey` 来指定数据列的主键。若没有指定,控制台会出现以下的提示,表格组件也会出现各类奇怪的错误。
|
||||
|
||||
![](https://os.alipayobjects.com/rmsportal/luLdLvhPOiRpyss.png)
|
||||
|
||||
```jsx
|
||||
const rowKey = function(record) {
|
||||
return record.uid; // 比如你的数据主键是 uid
|
||||
};
|
||||
|
||||
return <Table rowKey={rowKey} />;
|
||||
```
|
||||
|
@ -116,7 +116,7 @@ Ant Design React 支持所有的现代浏览器和 IE8+。
|
||||
<!-- 引入样式 -->
|
||||
<link rel="stylesheet" href="/index.css">
|
||||
<!-- Polyfills -->
|
||||
<script src="https://as.alipayobjects.com/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"></script>
|
||||
<script src="https://as.alipayobjects.com/??component/console-polyfill/0.2.2/index.js,component/es5-shim/4.1.14/es5-shim.min.js,component/es5-shim/4.1.14/es5-sham.min.js,component/html5shiv/3.7.2/html5shiv.min.js,g/component/media-match/2.0.2/media.match.min.js"></script>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
|
@ -1,6 +1,5 @@
|
||||
window['css-animation'] = require('css-animation');
|
||||
window['react-router'] = require('react-router');
|
||||
window.Clipboard = require('clipboard');
|
||||
window.Clip = require('./clip');
|
||||
var antd = require('../index');
|
||||
var React = require('react');
|
||||
|
@ -509,6 +509,7 @@ footer ul li > a {
|
||||
|
||||
.markdown img {
|
||||
vertical-align: middle;
|
||||
max-width: 100%;
|
||||
}
|
||||
|
||||
.markdown h1 {
|
||||
|
@ -18,7 +18,7 @@
|
||||
<!--[if IE 8]>
|
||||
<script src="https://t.alipayobjects.com/images/rmsweb/T1q8JiXftaXXXXXXXX.js"></script>
|
||||
<![endif]-->
|
||||
<script src="https://as.alipayobjects.com/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"></script>
|
||||
<script src="https://as.alipayobjects.com/??component/console-polyfill/0.2.2/index.js,component/es5-shim/4.1.14/es5-shim.min.js,component/es5-shim/4.1.14/es5-sham.min.js,component/html5shiv/3.7.2/html5shiv.min.js,g/component/media-match/2.0.2/media.match.min.js"></script>
|
||||
<script src="https://a.alipayobjects.com/??bluebird/2.9.30/bluebird.js,jquery/jquery/1.11.1/jquery.js"></script>
|
||||
<script>
|
||||
(function() {
|
||||
|
@ -235,6 +235,10 @@
|
||||
display: inline-block;
|
||||
text-align: center;
|
||||
margin: 0 0 0 8px;
|
||||
&-disabled {
|
||||
color: #ccc;
|
||||
cursor: not-allowed;
|
||||
}
|
||||
}
|
||||
|
||||
.@{calendar-prefix-cls}-clear-btn {
|
||||
|
Loading…
Reference in New Issue
Block a user