微信小程序(3)函数调用,参数传递

<view class="m-view-cell" bindtap="bindStatus" data-type="所有">所有</view>url

<view class="m-view-cell" bindtap="bindStatus" data-type="待受理">待受理</view>spa

<view class="m-view-cell" bindtap="bindStatus" data-type="已接单">已接单</view>get

一、bindtap 调用bindStatus()方法class

二、data-type="已接单" 接收参数type,该参数必须小写,大写也会自动变成小写方法

bindStatus(e) {view

let type = e.currentTarget.dataset.type;vi

wx.navigateTo({url: 'detail/detail?type=' + type,});},bind

相关文章
相关标签/搜索