这种怎么添加点击事件?不同的字段点击的时候调用不同的接口
<view class="comment ">
<view style="margin-left: 20px;">评论<span>{{thumbs}}span>view>
<view :class="{'n':1, 'n-pop':1, 'n-popShow': popConf.show}" style="margin-right: 20px;">
<text @tap.stop="popConf.show = !popConf.show">{{popConf.label}}text>
<view class="n-pop-menu">
<view class="sj">view>
<view :class="{'li':1, 'n-pop-cur': item.value === popConf.v}"
@tap="(popConf.v = item.value, popConf.label = item.label)"
v-for="item in popConf.list">{{item.label}}view>
view>
view>
view>
判断你所点击的对象在该对象父级中的子元素中,排列是第几,然后按照你的 接口去调用
https://www.jb51.net/article/264985.htm
<view :class="{'li':1, 'n-pop-cur': item.value === popConf.v}"
@tap="handleChange(item)"
v-for="item in popConf.list">{{item.label}}</view>
methods: {
handleChange(item) {
if(item.value == 1) {
this.a函数
} else if(item.value == 2) {
this.b函数
}
}
}