diff --git a/src/components/Echarts/index.js b/src/components/Echarts/index.js index fe86c8c..ce74756 100644 --- a/src/components/Echarts/index.js +++ b/src/components/Echarts/index.js @@ -1,7 +1,9 @@ import React, { Component } from 'react'; -import { WebView, View, StyleSheet, Platform } from 'react-native'; +import { View, StyleSheet, Platform } from 'react-native'; import renderChart from './renderChart'; import echarts from './echarts.min'; +import WebView from "react-native-webview"; +import getTpl from "./tpl" ; export default class App extends Component { @@ -34,7 +36,7 @@ export default class App extends Component { }} scalesPageToFit={Platform.OS !== 'ios'} originWhitelist={['*']} - source={require('./tpl.html')} + source={{ html:getTpl() }} onMessage={event => this.props.onPress ? this.props.onPress(JSON.parse(event.nativeEvent.data)) : null} /> diff --git a/src/components/Echarts/tpl.html b/src/components/Echarts/tpl.html deleted file mode 100644 index ca20a31..0000000 --- a/src/components/Echarts/tpl.html +++ /dev/null @@ -1,63 +0,0 @@ - - - - - echarts - - - - - - - -
- - diff --git a/src/components/Echarts/tpl.js b/src/components/Echarts/tpl.js new file mode 100644 index 0000000..485bf1c --- /dev/null +++ b/src/components/Echarts/tpl.js @@ -0,0 +1,28 @@ +export default ()=>` + + + + echarts + + + + + + + +
+ + +` ; \ No newline at end of file