javascript - weex跳weex传参,以及weex的h5页面之间传参?
迷茫
迷茫 2017-04-11 12:33:42
0
2
1012

看demo里注释说是通过

render(String template, Map<String, Object> options, String jsonInitData, WXRenderStrategy flag) 

   * @param options  os   iphone/android/ipad
   * @param jsonInitData Initial data for rendering

问题1:opteions传Map,可以通过weex.config取得。但jsonInitData是要传怎样的String才能正确地在data里读取?

问题2:opteions和jsonInitData在H5跳转H5过程中怎么传过去?

迷茫
迷茫

业精于勤,荒于嬉;行成于思,毁于随。

reply all(2)
左手右手慢动作

web页面直接传参,post或者get吧,目前navigator是不支持web页面直接直接传参的。
native你可以自己处理一下,当然jsonInitData,我也不是很了解他的作用,期待其他大神前来讲解。

巴扎黑

web端用vue-router做SPA,传参自然很方便。native端你则需要weex-vue-router,使用navigator跳转,能像vue-router一样的跳转、传参、取参。

Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template
About us Disclaimer Sitemap
php.cn:Public welfare online PHP training,Help PHP learners grow quickly!