微信小程序-wxml标签绑定data值传参给js方法(事件传参)

时间:2020-05-19 14:14:48   收藏:0   阅读:275

俗称页面绑定的事件传参

wxml

<view class="btn two" bindtap="goFn" data-name="{{item.name}}">客户档案</view>

js

  ...
  goFn(e){
    wx.navigateTo({
      url: "./details?name="+e.currentTarget.dataset.name
    })
  },

 

评论(0
© 2014 mamicode.com 版权所有 京ICP备13008772号-2  联系我们:gaon5@hotmail.com
迷上了代码!