add try catch, fixed #128

This commit is contained in:
xiaowei.wzw 2017-12-21 18:48:40 +08:00
parent aaa41db84d
commit d460685f6e
4 changed files with 8 additions and 8 deletions

2
demo/dist/bundle.js vendored

File diff suppressed because one or more lines are too long

View File

@ -105,7 +105,9 @@ var ReactEcharts = function (_React$Component) {
this.bindEvents(this.getEchartsInstance(), this.props.onEvents || []);
if (!isEqual(prevProps.style, this.props.style) || !isEqual(prevProps.className, this.props.className)) {
echartObj.resize();
try {
echartObj.resize();
} catch (_) {}
}
}

View File

@ -1,6 +1,6 @@
{
"name": "echarts-for-react",
"version": "2.0.1",
"version": "2.0.2",
"description": "baidu Echarts(v3.x) components for react",
"main": "lib/index.js",
"files": [

View File

@ -31,12 +31,10 @@ export default class ReactEcharts extends React.Component {
const echartObj = this.renderEchartDom();
this.bindEvents(this.getEchartsInstance(), this.props.onEvents || []);
if (
!isEqual(prevProps.style, this.props.style)
||
!isEqual(prevProps.className, this.props.className)
) {
if (!isEqual(prevProps.style, this.props.style) || !isEqual(prevProps.className, this.props.className)) {
try {
echartObj.resize();
} catch (_) {}
}
}