mirror of
https://github.com/nagisa77/OpenIsle.git
synced 2026-03-03 02:20:49 +08:00
feat(frontend_nuxt): wire up nprogress plugin
This commit is contained in:
18
frontend_nuxt/plugins/nprogress.client.ts
Normal file
18
frontend_nuxt/plugins/nprogress.client.ts
Normal file
@@ -0,0 +1,18 @@
|
||||
import NProgress from 'nprogress'
|
||||
import 'nprogress/nprogress.css'
|
||||
|
||||
export default defineNuxtPlugin((nuxtApp) => {
|
||||
NProgress.configure({ showSpinner: false })
|
||||
|
||||
nuxtApp.hook('page:start', () => {
|
||||
NProgress.start()
|
||||
})
|
||||
|
||||
nuxtApp.hook('page:finish', () => {
|
||||
NProgress.done()
|
||||
})
|
||||
|
||||
nuxtApp.hook('page:error', () => {
|
||||
NProgress.done()
|
||||
})
|
||||
})
|
||||
Reference in New Issue
Block a user