vue中使用<a>标签 页面内跳转滑动效果

<div @click="returnTop"> </div>

<div id="id"></div>

returnTop(){
    document.querySelector("id").scrollIntoView({
        behavior:"smooth",
        block:"start"
})
}
 {
    behavior: "auto"(默认)  | "instant" | "smooth"(缓动),
    block:    "start" | "end",
 }
posted @ 2019-12-26 14:35  ___mouM  阅读(2958)  评论(0编辑  收藏  举报