<template>
<view class="homepage">
<!-- 顶部导航栏 -->
<view class="horizonal-tab">
<scroll-view scroll-x="true" scroll-with-animation class="scroll-tab" :scroll-left="scrollleft">
<block v-for="(item,index) in tabBars" :key="index">
<view class="scroll-tab-item" :class="{'active': tabIndex==index}"
@tap="toggleTab(index,$event)">
{ {item.name}}
<view class="scroll-tab-line"></view>
</view>
</block>
</scroll-view
uni-app滑动菜单效果.既可以点击也可以滑动切换tab
最新推荐文章于 2024-06-03 13:38:13 发布