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

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

returnTop(){
    document.querySelector("id").scrollIntoView({
        behavior:"smooth",
        block:"start"
})
}
 {
    behavior: "auto"(默认)  | "instant" | "smooth"(缓动),
    block:    "start" | "end",
 }

相关文章:

  • 2021-11-17
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2021-07-01
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
猜你喜欢
  • 2021-12-27
  • 2022-12-23
  • 2021-11-17
  • 2022-12-23
  • 2021-08-26
  • 2022-12-23
相关资源
相似解决方案