美文网首页
native-echarts 禁止滚动

native-echarts 禁止滚动

作者: 精灵神帝 | 来源:发表于2018-10-25 17:09 被阅读0次

    importReact, { Component }from'react';

    import{ WebView, View, StyleSheet,Platform  }from'react-native';

    importrenderChartfrom'./renderChart';

    importechartsfrom'./echarts.min';

    exportdefaultclassAppextendsComponent{

        componentWillReceiveProps(nextProps) {

    if(nextProps.option !==this.props.option) {

    this.refs.chart.reload();

            }

        }

        render() {

    letscalesPageToFitValue;

    Platform.OS ==='ios'? (scalesPageToFitValue =false) : (scalesPageToFitValue =true)

    letsource = (Platform.OS ==='ios') ?require('./tpl.html'): {'uri':'file:///android_asset/tpl.html'}

    return(

    ref="chart"

    scrollEnabled={false}

    injectedJavaScript={renderChart(this.props)}

    style={{

    height:this.props.height||400,

    backgroundColor:this.props.backgroundColor|| 'transparent'

                        }}

    scalesPageToFit={scalesPageToFitValue}

    source={source}

    onMessage={event=> this.props.onPress ? this.props.onPress(JSON.parse(event.nativeEvent.data)) : null}

                    />

            );

        }

    }

    相关文章

      网友评论

          本文标题:native-echarts 禁止滚动

          本文链接:https://www.haomeiwen.com/subject/aeectqtx.html