Comparing version 0.7.3-beta3 to 0.7.3-beta4
@@ -31,2 +31,2 @@ require('./index.css'); | ||
antd.version = '0.7.3-beta3'; | ||
antd.version = '0.7.3-beta4'; |
@@ -47,17 +47,3 @@ 'use strict'; | ||
getInitialState: function getInitialState() { | ||
// 支持两种模式 | ||
if (Array.isArray(this.props.dataSource)) { | ||
this.mode = 'local'; | ||
// 保留原来的数据 | ||
this.originDataSource = this.props.dataSource.slice(0); | ||
} else { | ||
this.mode = 'remote'; | ||
this.dataSource = (0, _objectAssign2['default'])({ | ||
resolve: function resolve(data) { | ||
return data || []; | ||
}, | ||
getParams: function getParams() {}, | ||
getPagination: function getPagination() {} | ||
}, this.props.dataSource); | ||
} | ||
this.initDataSource(this.props.dataSource); | ||
@@ -91,3 +77,26 @@ var noPagination = this.props.pagination === false; | ||
} | ||
if ('dataSource' in nextProps) { | ||
this.initDataSource(nextProps.dataSource); | ||
this.setState({ | ||
data: nextProps.dataSource | ||
}); | ||
} | ||
}, | ||
initDataSource: function initDataSource(dataSource) { | ||
// 支持两种模式 | ||
if (Array.isArray(dataSource)) { | ||
this.mode = 'local'; | ||
// 保留原来的数据 | ||
this.originDataSource = dataSource.slice(0); | ||
} else { | ||
this.mode = 'remote'; | ||
this.dataSource = (0, _objectAssign2['default'])({ | ||
resolve: function resolve(data) { | ||
return data || []; | ||
}, | ||
getParams: function getParams() {}, | ||
getPagination: function getPagination() {} | ||
}, dataSource); | ||
} | ||
}, | ||
initPagination: function initPagination(pagination) { | ||
@@ -94,0 +103,0 @@ return (0, _objectAssign2['default'])({ |
{ | ||
"name": "antd", | ||
"version": "0.7.3-beta3", | ||
"version": "0.7.3-beta4", | ||
"stableVersion": "0.7.2", | ||
@@ -5,0 +5,0 @@ "title": "Ant Design", |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
243608
8924