native-echarts 禁止滚动

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}

                />

        );

    }

}


©著作权归作者所有,转载或内容合作请联系作者
平台声明:文章内容(如有图片或视频亦包括在内)由作者上传并发布,文章内容仅代表作者本人观点,简书系信息发布平台,仅提供信息存储服务。

推荐阅读更多精彩内容