彭水网站建设,wordpress设置非管理员,收录提交大全,阿里云wordpress效果图 在slot插槽中#xff0c;使用v-if指令来判断当前选项卡是否是当前激活的选项卡#xff08;即index是否等于currentTab#xff09;#xff0c;以及徽标数是否大于0。
viewu-tabs:listlistTab //标题数据:is-scrollfalse:curre…效果图 在slot插槽中使用v-if指令来判断当前选项卡是否是当前激活的选项卡即index是否等于currentTab以及徽标数是否大于0。
viewu-tabs:listlistTab //标题数据:is-scrollfalse:currentcurrentTab //下标changechangeTab //事件countbadgeCount //消息数字template v-slot:tabItem{ tab, index }span{{ tab.name }}/spansup v-ifindex currentTab badgeCount 0{{badgeCount}}/sup/template/u-tabs
/view
script
export default {data() {return {listTab: [{name: 待收货,badgeCount: 0,},{name: 待付款,badgeCount: 0,},{name: 待评价,badgeCount: 0,}],currentTab: 0,};},methods: {queryCustomNum() {queryCustomNum().then((res) {console.log(res);const readyReceivedNum res.data.readyReceivedNum;this.listTab[0].badgeCount readyReceivedNum;const obligationNum res.data.obligationNum;this.listTab[1].badgeCount obligationNum;const treatNum res.data.treatNum;this.listTab[2].badgeCount treatNum;});},
}
/script