elk/plugins/scroll-to-top.ts
2022-12-01 20:33:07 +08:00

9 lines
181 B
TypeScript

export default defineNuxtPlugin(() => {
return {
provide: {
scrollToTop: () => {
window.scrollTo({ top: 0, left: 0, behavior: 'smooth' })
},
},
}
})