scrollTo 方法是 JavaScript 中 Element 接口的一部分,用于将一个元素滚动到指定的位置。你提到的代码: dom.scrollTo({ top: 0, behavior: 'smooth' });