Update index.js

修改iOS上图表无法显示bug
This commit is contained in:
Mar-er 2019-04-08 16:32:44 +08:00 committed by GitHub
parent 2b222c123f
commit 584acc1b61
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 2 additions and 2 deletions

View File

@ -22,6 +22,7 @@ export default class App extends Component {
}
render() {
const source = Platform.OS === 'ios' ? require('./tpl.html') : {uri: 'file:///android_asset/tpl.html'}
return (
<View style={{flex: 1, height: this.props.height || 400,}}>
<WebView
@ -34,8 +35,7 @@ export default class App extends Component {
}}
scalesPageToFit={Platform.OS !== 'ios'}
originWhitelist={['*']}
// source={require('./tpl.html')}
source={{uri: 'file:///android_asset/tpl.html'}}
source={source}
onMessage={event => this.props.onPress ? this.props.onPress(JSON.parse(event.nativeEvent.data)) : null}
/>
</View>