WeChat Mini Program page jump transfer parameters

Components and API jump use

1. Use of navigatior component

 

<navigator url="/pages/login/login?username=nn&pwd=nn" hover-class="navigator-hover">跳转到登录界面</navigator>

2. Use the jump wx.navigateTo API

wx.navigateTo({

  url: '/pages/login/login?username=nn&pwd=nn'

})

Parameter receiving method

1. Method of receiving parameters

Get queryString in the options parameter of the onLoad method of the page

Page({

  onLoad: function (options) {

    console.log(options.username+options.pwd)

        

  }

})

 

Guess you like

Origin blog.csdn.net/weixin_39706415/article/details/90257381