<div @click="returnTop"> </div> <div id="id"></div> returnTop(){ document.querySelector("id").scrollIntoView({ behavior:"smooth", block:"start" }) }
{ behavior: "auto"(默认) | "instant" | "smooth"(缓动), block: "start" | "end", }