微信小程序链接传参并跳转新页面

网络编程 发布日期:2024/10/2 浏览次数:1

正在浏览:微信小程序链接传参并跳转新页面

 像传统的传参一样,只是在微信里面的标签不一样而已,navigator标签的文档说明

https://mp.weixin.qq.com/debug/wxadoc/dev/component/navigator.html"htmlcode">

<navigator class="bury-wrapper wx-li" url="../detail/detail"> 
<view>评19</view> 
</navigator>

url是../detail/detail....... 传递参数是id="{{item.id}}" url="../detail/detail"

detail.js代码如下

Page({ 
onLoad: function(options) { 
var duanziId = options.id 
var that = this 
wx.showToast({ 
title: '加载中', 
icon: 'loading', 
duration: 1000 
}) 
wx.request({ 
url: 'https://www.xxx.xxx"htmlcode">
<view class="duanzi-content"> 
<text class="dz-content">{{duanziDetail.content}}</text> 
</view>

app.json中pages配置代码如下

"pages":[ 
"pages/index/index", 
"pages/detail/detail", 
"pages/center/center", 
"pages/tucao/tucao", 
"pages/search/search" 
]

目录结构:

微信小程序链接传参并跳转新页面

以上所述是小编给大家介绍的微信小程序链接传参并跳转新页面,希望对大家有所帮助,如果大家有任何疑问请给我留言,小编会及时回复大家的。在此也非常感谢大家对网站的支持!