template.wxml
<template name="tabbar">
<view class="tabbar_box" style="background-color:{{tabbar.backgroundColor}}; border-top-color:{{tabbar.borderStyle}}; {{tabbar.position == 'top' ? 'top:0' : 'bottom:0'}}">
<block wx:for="{{tabbar.list}}" wx:for-item="item" wx:key="index">
<view bindtap="forter" data-id="{{item.id}}" class="tabbar_nav" style="width:{{1/tabbar.list.length*100}}%;">
<image class="tabbar_icon" src="{{item.selected ? item.selectedIconPath : item.iconPath}}"></image>
<text style="color:{{item.selected ? tabbar.selectedColor : tabbar.color}}">{{item.text}}</text>
</view>
</block>
</view>
</template>
template上绑定了一个名为forter的事件
template.js
var temp = {
forter: function (event){
//这个event为undefined
console.log(event)
}
}
export default temp