<view class="btnBox">
<view v-for="(item, index) in pageObj.btnList" :key="index">
<view class="page__bd">
<view class="page__bd page__bd_spacing title__bd walltBtnBox">
<image :src="walletImg[index]" class="walletImg"></image>
<button class="weui-btn walltBtn" @tap="tapClick(item.bindtap,{id:index})">{{item.name}}</button>
<view class="rightArrow arrowPosition"></view>
</view>
</view>
</view>
</view>
//data
btnList:[
{
bindtap:'one'
},
{
bindtap:'two'
}
]
//methods
tapClick(tap,params){ //循環使用不同點選事件
this[tap](params)
},
one(e){
console.log("id是:",e.id)
console.log("one")
},
two(e){
console.log("id是:",e.id)
console.log("two")
}