The page jump of WeChat applet adds the target address of the jump to the array The second and third level menu of WeChat applet (the application of navigateTo passing data)

When using wx.for to display the list, to jump from the item item of the list to the next page, you need to click on a different list to jump to a different page.

index.wxml

< view class = "carts-item" wx:for="{{items}}" bindtap= "navito"data-object-id= "{{item.id}}">
< view class = "carts-text">
         < text class = "carts-title"> {{item.name}} </ text >
</ view >
</ view >

index.js

data: {

items:[
{id: "1" ,name: "xxxxx" },
{id: "2" ,name: "yyyyy" },
],

Url:[

'../xxx/xxx' ,
'../yyy/yyy'
]
}

navito: function (e) {
// Click on a different list to jump to the list details
var that= this ;
var id = e.currentTarget.dataset.objectId- 1 ;
wx.navigateTo({
url: that.data.Url[id]
});
}

See the Daniel blog for many list jumps: https://blog.csdn.net/liona_koukou/article/details/52956058

The second and third level menu of WeChat applet (navigateTo application for transferring data)

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=324690287&siteId=291194637