weex icon indicating copy to clipboard operation
weex copied to clipboard

navigator的用法问题

Open guyikun opened this issue 10 years ago • 3 comments

Hi,请问navigator具体要怎么用? 我看了weex-dev 的examples\component下的navigator-demo.we代码, 结果Log显示 [JS Framework] Vm#$call is deprecated, please use "require('@weex-module/moduleName')" instead 而且weex examples\component\navigator-demo.we后点击push,跳转到 http://127.0.0.1:8081/weex_tmp/h5_render/index.html?page=./examples/build/component/navigator-demo.js?test=1 后界面一片空白? 是因为这个call的方式deprecated的问题还是源码的url的问题? 为什么手机上playground的navigator的那个案例是好的呢? 感谢~

guyikun avatar Nov 03 '16 07:11 guyikun

我看了下demo源码,是h5中push跳转的baseURL有误,我改成正确的然后提交pr,后续更新到demo代码中。 Vm#$call 方式确实已经废弃,使用var navigator = require('@weex-module/navigator');即可取到当前VM的navigator,然后调用push/pop方法即可。 文档参考:https://alibaba.github.io/weex/doc/modules/navigator.html

bluebird78999 avatar Nov 09 '16 06:11 bluebird78999

如何需要实现两步pop?这样实现怎样:navigator.pop({'animated' : 'false','step':'2'},function(){});

nisang avatar Nov 21 '16 03:11 nisang

目前不支持两步pop。

bluebird78999 avatar Nov 29 '16 07:11 bluebird78999