Compare commits
No commits in common. "master" and "0.5.0" have entirely different histories.
|
|
@ -26,7 +26,6 @@
|
||||||
},
|
},
|
||||||
"homepage": "https://github.com/somonus/react-native-echarts#readme",
|
"homepage": "https://github.com/somonus/react-native-echarts#readme",
|
||||||
"dependencies": {
|
"dependencies": {
|
||||||
"echarts": "3.2.3",
|
"echarts": "3.2.3"
|
||||||
"react-native-webview":"13.8.7"
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,6 +1,5 @@
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { View, StyleSheet, Platform } from 'react-native';
|
import { WebView, View, StyleSheet, Platform } from 'react-native';
|
||||||
import WebView from 'react-native-webview';
|
|
||||||
import renderChart from './renderChart';
|
import renderChart from './renderChart';
|
||||||
import echarts from './echarts.min';
|
import echarts from './echarts.min';
|
||||||
|
|
||||||
|
|
@ -12,7 +11,7 @@ export default class App extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
UNSAFE_componentWillReceiveProps(nextProps) {
|
componentWillReceiveProps(nextProps) {
|
||||||
if(nextProps.option !== this.props.option) {
|
if(nextProps.option !== this.props.option) {
|
||||||
this.refs.chart.reload();
|
this.refs.chart.reload();
|
||||||
}
|
}
|
||||||
|
|
@ -23,10 +22,6 @@ export default class App extends Component {
|
||||||
}
|
}
|
||||||
|
|
||||||
render() {
|
render() {
|
||||||
const source = Platform.OS === 'ios'
|
|
||||||
? require('./tpl.html') // iOS使用require方式加载
|
|
||||||
: { uri: 'file:///android_asset/tpl.html' }; // Android从assets目录加载
|
|
||||||
|
|
||||||
return (
|
return (
|
||||||
<View style={{flex: 1, height: this.props.height || 400,}}>
|
<View style={{flex: 1, height: this.props.height || 400,}}>
|
||||||
<WebView
|
<WebView
|
||||||
|
|
@ -39,7 +34,7 @@ export default class App extends Component {
|
||||||
}}
|
}}
|
||||||
scalesPageToFit={Platform.OS !== 'ios'}
|
scalesPageToFit={Platform.OS !== 'ios'}
|
||||||
originWhitelist={['*']}
|
originWhitelist={['*']}
|
||||||
source={source}
|
source={require('./tpl.html')}
|
||||||
onMessage={event => this.props.onPress ? this.props.onPress(JSON.parse(event.nativeEvent.data)) : null}
|
onMessage={event => this.props.onPress ? this.props.onPress(JSON.parse(event.nativeEvent.data)) : null}
|
||||||
/>
|
/>
|
||||||
</View>
|
</View>
|
||||||
|
|
|
||||||
|
|
@ -1,7 +1,5 @@
|
||||||
import React, { Component } from 'react';
|
import React, { Component } from 'react';
|
||||||
import { View } from 'react-native';
|
import { WebView, View } from 'react-native';
|
||||||
import WebView from 'react-native-webview';
|
|
||||||
|
|
||||||
import { Container, Echarts } from './components'
|
import { Container, Echarts } from './components'
|
||||||
|
|
||||||
export default class App extends Component {
|
export default class App extends Component {
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue