滚动条问题
为什么滚动条引入到里面拖动不了
//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
收起
正在回答
2回答

你好同学,将您提供的代码放入源码中,经过测试分类页的侧栏也是可以拖动的
相似问题
登录后可查看更多问答,登录/注册
热门框架Vue开发WebApp 18版
- 参与学习 人
- 提交作业 209 份
- 解答问题 3299 个
本路径是通过ES6基础知识、运用Zepto、Swiper、fullPag等移动端常用工具包、以及当下流行框架Vue,结合多个实战案例,还原真实开发场景,最终实现手机端购物商城网页开发。
了解课程

恭喜解决一个难题,获得1积分~
来为老师/同学的回答评分吧
0 星