From 72effbe06ae1795b2dd24ab8c8bfc7e38aef88cf Mon Sep 17 00:00:00 2001 From: lihang Date: Sat, 27 Jan 2018 09:06:00 +0800 Subject: [PATCH] fix android release pacckage not work --- src/components/Echarts/index.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/components/Echarts/index.js b/src/components/Echarts/index.js index 1050ae3..3f3c071 100644 --- a/src/components/Echarts/index.js +++ b/src/components/Echarts/index.js @@ -1,5 +1,5 @@ import React, { Component } from 'react'; -import { WebView, View, StyleSheet } from 'react-native'; +import { WebView, View, StyleSheet, Platform } from 'react-native'; import renderChart from './renderChart'; import echarts from './echarts.min'; import PropTypes from "prop-types"; @@ -32,7 +32,7 @@ export default class App extends Component { backgroundColor: this.props.backgroundColor || 'transparent' }} scalesPageToFit={false} - source={require('./tpl.html')} + source={(Platform.OS == 'ios') ? require('./tpl.html') : {uri:'file:///android_asset/tpl.html'}} onMessage={event => this.props.onPress ? this.props.onPress(JSON.parse(event.nativeEvent.data)) : null} {...this.props} />