Home > WeChat Applet > Mini Program Development > Detailed explanation of the code for jumping and transferring data in WeChat applet

Detailed explanation of the code for jumping and transferring data in WeChat applet

黄舟
Release: 2017-09-13 10:57:22
Original
2091 people have browsed it

This article mainly introduces relevant information about examples of jump and transfer data in WeChat applet. Friends in need can refer to

Instances of jump and transfer of data in WeChat applet

Click view to jump to the page


<view class="album_image" data-album-obj="{{item}}" bindtap="imageclick"> 
    <image style="width:98%;" src="{{item.data[0].url}}"></image>
</view>
Copy after login

Declare variables data-album-obj

Page jump Go to


imageclick:function(e){
  console.log(e.currentTarget.dataset.albumObj);
  wx.navigateTo({
   url: &#39;albumdetail?str=&#39; + JSON.stringify(e.currentTarget.dataset.albumObj),
  })
 },
Copy after login

Get the object in the interface after the jump


 onLoad: function (options) {
   this.setData({
    albumData: JSON.parse(options.str)
   })
 },
Copy after login

The above is the detailed content of Detailed explanation of the code for jumping and transferring data in WeChat applet. For more information, please follow other related articles on the PHP Chinese website!

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template