Madman11
Madman11
  • 发布:2021-01-27 11:30
  • 更新:2021-01-27 11:30
  • 阅读:495

UNIAPP自定义导航栏 无法实现左右滑动,是怎么回事呢?

分类:uni-app
<template>  
    <view>  
        <uni-nav-bar left-icon="back">  
            <!-- <tab-bar-head :tabBars="tabBars" :tabIndex="tabIndex" @tapTap="tapTap"></tab-bar-head> -->  
            <view>  
                <view class="uni-tab-bar">  
                    <scroll-view class="uni-swiper-tab" scroll-x>  
                        <view class="swiper-tab-list" v-for="item in tabBars" :key="item.id">  
                            {{item.name}}  
                        </view>  
                    </scroll-view>  
                </view>  
            </view>  
        </uni-nav-bar>  
    </view>  
</template>  

<script>  
    import uniNavBar from '../../components/uni-nav-bar/uni-nav-bar.vue'  
    import tabBarHead from '../../components/note/tab-bar-head.vue'  
    export default {  
        components:{  
            uniNavBar,  
            tabBarHead  
        },  
        data() {  
            return {  
                tabIndex:0,  
                tabBars:[  
                    {  
                        'id':1,  
                        'name':'法律法规'  
                    },  
                    {  
                        'id':2,  
                        'name':'工程经济'  
                    },  
                    {  
                        'id':3,  
                        'name':'工程管理'  
                    },  
                    {  
                        'id':4,  
                        'name':'技术实务'  
                    },  
                    {  
                        'id':5,  
                        'name':'技术实务'  
                    },  
                    {  
                        'id':6,  
                        'name':'技术实务'  
                    },  
                    {  
                        'id':7,  
                        'name':'技术实务'  
                    }  
                ]  
            }  
        },  
        methods: {  
            tapTap(index){  
                this.tabIndex=index  
            }  
        }  
    }  
</script>  

<style>  

</style>  

2021-01-27 11:30 负责人:无 分享
已邀请:

该问题目前已经被锁定, 无法添加新回复