supervons / react-native-echarts-pro

A React-Native charts based on Apache ECharts, support various charts and map.
https://supervons.github.io/react-native-echarts-pro-docs/
MIT License
216 stars 32 forks source link

事件不能触发 #83

Closed J3020605821 closed 1 year ago

J3020605821 commented 1 year ago

问题:点击事件不能触发 "react-native-echarts-pro": "^1.8.7", "react-native": "0.69.6", "react-native-webview": "11.23.0", 平台;linux 系统版本;Ubuntu 20.04.4 LTS

J3020605821 commented 1 year ago

图片

J3020605821 commented 1 year ago

望回复

J3020605821 commented 1 year ago

还有一个组件的点击事件不触发: 图片

youngerbyte commented 1 year ago

1.eventActions中不要拿click和onclick去接收,接收后点击时里面就报错,此sdk文档说明不详细造成使用错误后web报错但为抛出,所以开发者感知不到 2.click需要拿onPress接收,例如: <RNEChartsPro ref={chartRef} height={props.height} option={props.option} onPress={(params) => { console.warn('✅click:'+JSON.stringify(params)); }} eventActions={{ finished:()=>{ console.warn('✅finished'); }, }}/>;

supervons commented 1 year ago

如楼上所说,legendSelectChangedonDataZoom, onPress 其实都无需用 eventActions,直接使用即可,后续会在文档中详细说明。

另外,对于文档有任何改进可以关注 https://github.com/supervons/react-native-echarts-pro-website