您的当前位置:首页正文

微信小程序的坑

来源:华佗小知识

瞎捣鼓个微信小程序,写一个列表,点击进详情页面需要传值,在携带值时发现。

 <view  data-channelId="{{item.channelId}}"  bindtap="toDetail" ></view>

明明写的是 channelId,但是点击时,却获取不到

console.log(event.currentTarget.dataset.channelId)

只有改为小写的channelid,才获取到。。。这,是我起名不规范么