在项目需求中需要实现一个滚轴联动锚点的功能
效果图如下:
功能代码demo如下:
{{item.name}}
* {
padding: 0;
margin: 0;
}
.nav1 {
display: block;
width: 40px;
height: 40px;
text-align: center;
line-height: 40px;
background: #eee;
margin: 10px 0;
}
.current {
color: #fff;
background: red;
}
以上这篇Vue监听滚动实现锚点定位(双向)示例就是小编分享给大家的全部内容了,希望能给大家一个参考,也希望大家多多支持考高分网。



