<template>
<div class="check-container">
<Row type="flex" class="app-content">
<Col span="22" style="padding-bottom: 16px;">
<div id="0001" style="height:500px;border:1px solid red">
</div>
<div id="0002" style="height:500px;border:1px solid">
</div>
<div id="0003" style="height:500px;border:1px solid blue">
</div>
<div id="0004" style="height:500px;border:1px solid blue">
</div>
</Col>
<Col span="2">
<Anchor show-ink container=".app-content" :offset-top="100" show-ink style="position:fixed;padding-left: 16px;padding-top: 16px">
<AnchorLink href="#0001" title="0001" />
<AnchorLink href="#0002" title="0002" />
<AnchorLink href="#0003" title="0003">
<AnchorLink href="#0004" title="0004">
</AnchorLink>
</Anchor>
</Col>
</Row>
</div>
</template>
<style>
.check-container{
height: 100%;
overflow-y: hidden;
}
.app-content{
position: relative;
overflow-y: scroll;
height:100vh;
}
</style>
<script>
export default {
}
</script>
Anchor的container=".app-content"必须写,
最外层div的class="check-container"需要设置高度,
需要滚动的部分也需要设置一个高度 height:100vh;