微信小程序页面跳转组件navigator

官方navigator组件文档 https://developers.weixin.qq.com/miniprogram/dev/component/navigator.html

在index.wxml文件中定义一个navigator

访问list列表页

跳转的页面是…/list/list

list.wxml文件的内容

这里是列表页,huangbaokang

编译测试,跳转默认是当前小程序跳转,跳转之后有一个回退的按钮。
微信小程序页面跳转组件navigator_第1张图片
如果open-type=“redirect”,在没有回退箭头。
增加点击时相关样式

index.wxml

访问list列表页

index.wxss

.buleTheme{
  color: blue;
}

跳转到新页面参数传递


访问list列表页

这里是列表页,{{author}}

/**
   * 生命周期函数--监听页面加载
   */
  onLoad: function (options) {
    this.setData({
      author : options.author
    })
  },

如果open-type=“switchTab”,则url不支持queryString


马上去支付

支付中心页面

app.json配置tabBar

  "tabBar": {
    "list": [{
      "pagePath": "pages/index/index",
      "text": "huangbaokang"
    },
    {
      "pagePath": "pages/list/list",
      "text": "支付中心"
    }
    ]
  },

微信小程序页面跳转组件navigator_第2张图片

点击去支付,将跳转tabBar
微信小程序页面跳转组件navigator_第3张图片

你可能感兴趣的:(微信小程序)