Home  >  Article  >  WeChat Applet  >  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

黄舟
黄舟Original
2017-09-13 10:57:222061browse

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>

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),
  })
 },

Get the object in the interface after the jump


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

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!

Statement:
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