【发布时间】:2021-05-12 10:19:38
【问题描述】:
我想使用 Vue JS 创建页面的自动滚动我查看了一些选项,但它们没有帮助我这是我的代码
<template>
<div class="wrapper">
<div class="main"></div>
<div class="main"></div>
<div class="main"></div>
<div class="main"></div>
</div>
</template>
<style scoped>
.wrapper {
width: min-content;
margin: auto;
height: 400px;
overflow: scroll;
}
.main {
width: 250px;
height: 200px;
background: red;
border: 1px solid white;
margin-bottom: 10px;
}
</style>
这是给定的code in codesandbox
【问题讨论】:
标签: javascript vue.js vuejs2 scroll