老师,为什么我的tab滚不动??

来源:1-1 Header和侧栏

Syrena3447375

2020-03-22 11:53:40

<template>

    <category-scroll :scrollbar="false" class="scroll">

        <ul class="tab">

            <li class="tab-item" v-for="(item, index) in categoryNames" :key="index">

                {{item.name}}

            </li>

        </ul>

    </category-scroll>

</template>

<script>

import CategoryScroll from 'base/scroll'

import {categoryNames} from './config.js'


export default {

    name: 'CategoryTab',

    data() {

        return {

            categoryNames: categoryNames

        }

    },

    components: {

        CategoryScroll

    }

}

</script>

<style lang="scss" >

@import '~assets/scss/mixins';


    .tab {

        width: 100%;


        &-item {

        height: $tab-item-height;

        background-color: #fff;

        border-right: 1px solid $border-color;

        border-bottom: 1px solid $border-color;

        color: #080808;

        font-size: $font-size-l;

        font-weight: bold;

        text-align: center;

        line-height: $tab-item-height;

        @include ellipsis();


        &:last-child {

            border-bottom: none;

        }

        }


        &-item-active {

        background: none;

        border-right: none;

        color: #f23030;

        }

    }

</style>


写回答

2回答

好帮手慕糖

2020-03-22

同学你好,能够自己发现并解决问题,很棒哦,继续加油!

祝学习愉快~

0

好帮手慕糖

2020-03-22

同学你好,老师这里测试是滚动的哦,不过,如下有一个问题,$tab-item-height: 46px;没有定义,需要定义下,例:

http://img.mukewang.com/climg/5e77128509f7e36b04430314.jpg

老师是将这部分代码粘贴到源码中运行的,不知道是否是其他文件的导致的,可以查看下是否有报错,若还是无法解决,可以提供下其他文件的代码。

祝学习愉快~

0
hyrena3447375
h 老师,可以了,我的.g-content-container没有设height:100%
h020-03-22
共3条回复

0 学习 · 10739 问题

查看课程