跳转页面传参:
html:
<view class="vidli" wx:for="{ {videoList}}" wx:key="{ {item.v_id}}" data-vid="{ {item.v_id}}" bindtap="videoinfo" >
</view>
js:
videoinfo: function (e) {
let vid = e.currentTarget.dataset.vid;
wx.navigateTo({
url: "../videoinfo/videoinfo?vid=" + vid
})
},
获取页面url及参数:
onLoad: function (options) {
// console.log(options);
this.setData({
playindex: options.vid
})
// console.log(2);
},
其他相关文章:
微信小程序怎么获取当前页面的url:https://segmentfault.com/q/1010000008005954