微信小程序 跳转传递数据的实例
点击view 跳转页面
<view class="album_image" data-album-obj="{{item}}" bindtap="imageclick"> <image style="width:98%;" src="{{item.data[0].url}}"></image> </view>
声明变量 data-album-obj
页面跳转
imageclick:function(e){ console.log(e.currentTarget.dataset.albumObj); wx.navigateTo({ url: 'albumdetail?str=' + JSON.stringify(e.currentTarget.dataset.albumObj), }) },
跳转后的界面获取对象
onLoad: function (options) { this.setData({ albumData: JSON.parse(options.str) }) },
感谢阅读,希望能帮助到大家,谢谢大家对本站的支持!
您可能感兴趣的文章:
- 微信小程序 template模板详解及实例
- 微信小程序 template模板详解及实例代码
- 微信小程序视图template模板引用的实例详解
- 微信小程序template模板实例详解
- 微信小程序 Template详解及简单实例
- 微信小程序-详解微信登陆、微信支付、模板消息
- 微信小程序使用navigateTo数据传递的实例
- 微信小程序 页面跳转和数据传递实例详解
- 微信小程序实现给嵌套template模板传递数据的方式总结