自定义tap组件,无法获取event的值
WXML:
<view class="tabs">
<view class="tabs_title">
<view class="title_item {{item.isActive?'active':''}}"
wx:for="{{tabs}}"
wx:key="id"
bindtab="itemTap"
data-index="{{index}}">
{{item.value}}
</view>
</view>
<view class="tabs_content" ></view>
</view>
JSON:
methods: {
itemTap(e){
const {index} = e.currentTarget.dataset;
console.log(index);
}
},
这里是bindtap