老师,是哪里错了啊,滚动不了啊

老师,是哪里错了啊,滚动不了啊

<template>

    <div class="list" ref ="wrapper">

        <div>

            <div class="area">

                <div class="title border-topbottom">当前城市</div>

                <div class="buttonlist">

                    <div class="button-wrapper">

                    <div class="button">北京</div>

                    </div>

                </div>

            </div>

            <div class="area">

                <div class="title border-topbottom">热门城市</div>

                <div class="buttonlist">

                    <div class="button-wrapper">

                    <div class="button">北京</div>

                    </div>

                    <div class="button-wrapper">

                    <div class="button">深圳</div>

                    </div>

                    <div class="button-wrapper">

                    <div class="button">南京</div>

                    </div>

                    <div class="button-wrapper">

                    <div class="button">上海</div>

                    </div>

                    <div class="button-wrapper">

                    <div class="button">广西</div>

                    </div>

                </div>

            </div>

            <div class="area">

                <div class="title border-topbottom">A</div>

                <div class="item-list">

                    <div class="item border-bottom">阿拉善</div>

                    <div class="item border-bottom">阿拉善</div>

                    <div class="item border-bottom">阿拉善</div>

                    <div class="item border-bottom">阿拉善</div>

                    <div class="item border-bottom">阿拉善</div>

                    <div class="item border-bottom">阿拉善</div>

                </div>

            </div>

            <div class="area">

                <div class="title border-topbottom">B</div>

                <div class="item-list">

                    <div class="item border-bottom">阿拉善</div>

                    <div class="item border-bottom">阿拉善</div>

                    <div class="item border-bottom">阿拉善</div>

                    <div class="item border-bottom">阿拉善</div>

                    <div class="item border-bottom">阿拉善</div>

                    <div class="item border-bottom">阿拉善</div>

                </div>

            </div>

            <div class="area">

                <div class="title border-topbottom">C</div>

                <div class="item-list">

                    <div class="item border-bottom">阿拉善</div>

                    <div class="item border-bottom">阿拉善</div>

                    <div class="item border-bottom">阿拉善</div>

                    <div class="item border-bottom">阿拉善</div>

                    <div class="item border-bottom">阿拉善</div>

                    <div class="item border-bottom">阿拉善</div>

                </div>

            </div>

            <div class="area">

                <div class="title border-topbottom">D</div>

                <div class="item-list">

                    <div class="item border-bottom">阿拉善</div>

                    <div class="item border-bottom">阿拉善</div>

                    <div class="item border-bottom">阿拉善</div>

                    <div class="item border-bottom">阿拉善</div>

                    <div class="item border-bottom">阿拉善</div>

                    <div class="item border-bottom">阿拉善</div>

                </div>

            </div>

        </div>

    </div>

</template>


<script>

import Bscroll from 'better-scroll'

export default {

  name: 'CityList',

  mounted(){

      this.scroll = new Bscroll(this.$refs.wrapper)

  }

}

</script>


<style lang="stylus" scoped>

@import '~styles/varibles.styl'

    .border-topbottom

        &:before

            border-color #ccc

        &:after

            border-color #ccc

    .border-bottom

        &:before

            border-color #ccc

    .list

        overflow hidden

        position absolute

        top 1.58rem

        left 0

        right 0

        bottom 0

        .title

            line-height .44rem

            background #eee

            padding-left .2rem

            color #666

            font-size .26rem

        .buttonlist

            overflow hidden

            padding .1rem .6rem .1rem .1rem

            .button-wrapper

                float left

                width 33.33%

                .button

                    padding .1rem

                    text-align center

                    margin .1rem

                    border .05rem solid #ccc

                    border-radius .06rem

        .item-list

            .item

                line-height .54rem

                color #666

                padding-left .2rem

</style>


正在回答 回答被采纳积分+1

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

2回答
好帮手慕码 2020-08-24 19:30:17

同学你好,点击鼠标拖动更多的是模拟移动端手指触发滑动的效果,而滚动的话,一般是在电脑端滚动鼠标滚轮实现的效果;二者是触发的时机不一样,并不是说哪一个更有优势。

祝学习愉快~

好帮手慕码 2020-08-24 16:47:26

同学你好,这边测试是可以滚动的:

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

同学可以再试一下(建议:保存后,重启命令行),祝学习愉快~

  • 提问者 慕雪9296518 #1
    可以了,原来是鼠标点击才可以拖动,这跟滚动有什么区别,为什么要这样做有什么优势吗
    2020-08-24 18:22:53
问题已解决,确定采纳
还有疑问,暂不采纳

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

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

0 星
请稍等 ...
意见反馈 帮助中心 APP下载
官方微信

在线咨询

领取优惠

免费试听

领取大纲

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