<template>
<div class="parent">
<div class="child">
<!-- 假设这里有很多内容 -->
<p v-for="n in 100" :key="n">内容 {{ n }}</p>
</div>
</div>
</template>
<style scoped>
.parent {
height: 100vh;
width: 100%;
position: relative; // 主要就是这
}
.child {
height: 100%;
overflow: auto;
/* 其他样式 */
}
</style>
12-02
1534