fix: scrollToTop does not work as expected (#271)

zio/stable
Ayaka Rizumu 2022-12-01 20:33:07 +08:00 committed by GitHub
parent 2b46bd5a15
commit e3ab850cc1
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -2,7 +2,7 @@ export default defineNuxtPlugin(() => {
return { return {
provide: { provide: {
scrollToTop: () => { scrollToTop: () => {
document.body.scrollTo(0, 0) window.scrollTo({ top: 0, left: 0, behavior: 'smooth' })
}, },
}, },
} }