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

This commit is contained in:
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

View file

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