larry6

导航

微信小程序跳转页面

小程序页面有2种跳转,可以在wxml页面或者js中:

1,在wxml页面中:

  <navigator url="../index/index">跳转到新页面</navigator>
  <navigator url="../index/index" open-type="redirect">在当前页打开</navigator>
  <navigator url="../index/index" open-type="switchTab">切换到首页Tab</navigator>

2,在js页面中:

  

【注意】此处注意两个关键词 “应用内的页面” 和 “tabBar页面”。  app.json文件中tabBar中注册过的tab页,即为“tabBar页面”,非tabBar中注册占用的页面即为“应用内的页面” 。 如下图:home页面为“应用内的页面”,index和logs页面则为 “tabBar页面”。

 

 



posted on 2017-01-13 00:36  larry6  阅读(2398)  评论(3编辑  收藏  举报