You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
@1610449813 android release版本通过“把tpl.html文件放在android/app/src/main/assets文件里,使用uri:'file:///android_asset/tpl.html'这个地址加载”已解决!但是IOS下将tpl.html放在项目的一个新建文件夹下,在报URL was not found 的错误,大家都有遇到吗?
在 2017年2月24日,16:02,wangchongwei ***@***.***> 写道:
@1610449813 请问一下如何实现echarts和native的通信?
点击事件?要如何设置,在html中吗?
—
You are receiving this because you were mentioned.
Reply to this email directly, view it on GitHub, or mute the thread.
Activity
WhatAKitty commentedon Dec 4, 2016
我把它升级成0.39,但是打包还是不行
zt-boom commentedon Dec 7, 2016
真的感谢这个组件,但是release版本真机测试也是无法显示图标,react-native版本是0.34,急求修复
somonus commentedon Dec 7, 2016
这是react-native的一个bug,解决方案参考facebook/react-native#6004
1610449813 commentedon Dec 7, 2016
release版本只能使用uri加载资源,android把tpl.html文件放在android/app/src/main/assets文件里,使用uri:'file:///android_asset/tpl.html'这个地址加载,ios在项目目录下建个文件夹,把tpl文件放里面去,使用uri:'文件名/tpl'加载,这样能使用,但是好像无法使用webview和native见得通信
1610449813 commentedon Dec 8, 2016
无法通信找到解决方法了,但是无法使用官方自己的webview,我使用react-native-webview-bridge这个,打包时忽略这个组建的webview方法就行了
zt-boom commentedon Dec 8, 2016
@1610449813 这个问题解决了么,要我自己去改写这个组件么?
1610449813 commentedon Dec 8, 2016
@ztMalone 恩,如果你不需要webview和native通信,可以使用原生的webview,把他组件里Echarts文件夹的index文件webview source路径改成我上面说的,要是需要通信的话,使用我上面说的第三方组件
lin493369 commentedon Jan 4, 2017
facebook/react-native#505
参考 @1610449813 的答案。已解决!
huzhiqi commentedon Jan 10, 2017
按照@1610449813 的方法还是没有解决
Rylai-Zihang commentedon Jan 17, 2017
@1610449813 android release版本通过“把tpl.html文件放在android/app/src/main/assets文件里,使用uri:'file:///android_asset/tpl.html'这个地址加载”已解决!但是IOS下将tpl.html放在项目的一个新建文件夹下,在报URL was not found 的错误,大家都有遇到吗?
belynnyond commentedon Feb 7, 2017
@Rylai-Zihang 大兄弟,你这个问题解决了么
wangchongwei commentedon Feb 24, 2017
@1610449813 请问一下如何实现echarts和native的通信?
点击事件?要如何设置,在html中吗?
zt-boom commentedon Feb 24, 2017
16 remaining items
simonguo commentedon Nov 9, 2017
@wangchongwei @1610449813 通讯可以使用 onMessage
在
WebView
上设置一个 onMessage , 然后在 option 里面中的 function 中 可以通过 window.postMessage 传值。amijabd commentedon Jan 26, 2018
Please explain why need to modify:
Source = {require ('./tpl.html')}
to
Modify Is: source = {{uri: 'file: ///android_asset/tpl.html'}}
and where do I modify this?
will86 commentedon Jan 26, 2018
@amijabd
The component WebView powered by Facebook requires that modify...
File of this path
./node_modules/native-echarts/src/components/Echarts/index.js
needs to be modifiedamijabd commentedon Jan 29, 2018
Yes, I made those changes based on the above by putting this:
source = {{uri: 'file: ///android_asset/tpl.html'}}
Still after I made a release, the charts still can't be viewed. Not sure what I'm doing wrong.
*When running the emulator, the chart no longer show after the modified code was made.
amijabd commentedon Jan 30, 2018
Here's the page I did for one of the charts. Not sure where I'm going wrong.
will86 commentedon Jan 30, 2018
@amijabd
Confirm that, does the file
tpl.html
exists in the path./android/app/src/main/assets/tpl.html
?amijabd commentedon Jan 30, 2018
Nope. Its not there. I did the bundling but its not there.
There is however a file in
/android/app/src/main/res/raw
with the name node_modules_nativeecharts_src_components_echarts_tpl.htmlamijabd commentedon Jan 30, 2018
@will86
Okay. Managed to figure it out. Thanks for the assist.
priyankverma commentedon Feb 27, 2018
@amijabd I have exactly the same problem, how you fixed the problem?
dongyuekai commentedon Aug 6, 2018
我这边遇到一个问题 加载china map的时候,在安卓上一切OK,在iOS上 模拟器正常,连线跑到真机上一切正常,release出ipa包后装到手机上就不显示了,最后找到了原因是因为html模板加载路径问题,解决办法如下:
1.在项目全局运行npm run bundle-ios
2.我把html中引用的加载js路径不正确的js文件直接拷贝到了html中,这样不存在路径问题了
经验证,iOS的release模式可以显示出来了
yangmingfa commentedon Sep 16, 2018
iOS的release包下图标无法显示,在项目下建立文件夹来存放tpl.html也是不行,android的配置可以了,求各位大佬指点下iOS的路径到底要怎么配置?
SiroSong commentedon Sep 24, 2019
你这个中文是英语老师教的吧,,,,,第二条你自己读试试,能读懂吗?