滚动条问题

滚动条问题

为什么滚动条引入到里面拖动不了

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
//tab.vue
<template>
    <me-scroll :scrollbar="false">
        <ul class="tab">
            <li 
              class="tab-item"
              :class="{'tab-item-active':item.id===curId}" 
              v-for="(item,index) in items"
              :key="index"
              @click="switchTab(item.id)"
            >{{item.name}}
            </li>
        </ul>
    </me-scroll>
</template>
 
<script>
    import MeScroll from 'base/scroll'
    import {categoryNames} from './config.js'
 
    export default{
        name:'CategoryTab',
        components:{
            MeScroll
        },
        data(){
            return {
                curId:''
            }
        },
        created(){
            this.init(),
            this.switchTab(this.items[0].id)
        },
        methods:{
            init(){
                this.items = categoryNames;
            },
            switchTab(id){
                if(this.curId === id){
                    return;
                }
                this.curId = id;
                this.$emit('switch-tab',id);
            }
        }
    }
</script>
 
<style scoped>
    @import "~assets/scss/mixins";
    $tab-item-height: 46px;
 
    .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>
 
//index.vue
<template>
    <div class="category">
        <header class="g-header-container">
            <category-header/>
        </header>
        <div class="g-content-container">
            <div class="sidebar">
                <category-tab/>
            </div>
            <div class="main">
                 
            </div>
        </div>
         
    </div>
</template>
 
<script>
    import CategoryHeader from './header.vue'
    import CategoryTab from './tab.vue'
 
    export default{
        name:'Category',
        components:{
            CategoryHeader,
            CategoryTab
        }
    };
 
</script>
 
<style scoped>
    @import "~assets/scss/mixins";
 
    .category{
        overflow: hidden;
        width: 100%;
        height: 100%;
        background-color: $bgc-theme;
    }
 
    .g-content-container{
        display: flex;
        margin-top: $navbar-height;
    }
    .sidebar{
        width: 80px;
        height: 100%;
    }
    .main{
        flex:1;
        height: 100%;
    }
</style>


正在回答

登陆购买课程后可参与讨论,去登陆

2回答

http://img1.sycdn.imooc.com//climg/5b90d37b00012a9f08341094.jpg

你好同学,将您提供的代码放入源码中,经过测试分类页的侧栏也是可以拖动的

  • 慕瓜9263510 提问者 #1
    我的直接在最顶端显示 无视了header头部 而且有拉不动 老师 那这应该是哪个地方出问题呢
    2018-09-06 15:23:44
  • 慕瓜9263510 提问者 #2
    老师 好了 找到错误了 感谢
    2018-09-06 15:47:23
妮可妮可妮_ 2018-09-06 11:20:07

http://img1.sycdn.imooc.com//climg/5b909ca8000114de11010759.jpg

将同学的代码放在我们的源码中,是没有问题的,可以出现滚动条的哦~

请同学检查其他文件是否有误

祝学习愉快!

  • 提问者 慕瓜9263510 #1
    是侧栏 拖不动
    2018-09-06 14:18:56
  • 提问者 慕瓜9263510 #2
    分类页的侧栏
    2018-09-06 14:19:55
问题已解决,确定采纳
还有疑问,暂不采纳

恭喜解决一个难题,获得1积分~

来为老师/同学的回答评分吧

0 星
热门框架Vue开发WebApp 18版
  • 参与学习           人
  • 提交作业       209    份
  • 解答问题       3299    个

本路径是通过ES6基础知识、运用Zepto、Swiper、fullPag等移动端常用工具包、以及当下流行框架Vue,结合多个实战案例,还原真实开发场景,最终实现手机端购物商城网页开发。

了解课程
请稍等 ...
微信客服

购课补贴
联系客服咨询优惠详情

帮助反馈 APP下载

慕课网APP
您的移动学习伙伴

公众号

扫描二维码
关注慕课网微信公众号

在线咨询

领取优惠

免费试听

领取大纲

扫描二维码,添加
你的专属老师
插入代码