first commit

This commit is contained in:
2026-09-21 19:21:35 +08:00
commit 6c944c4ffd
2733 changed files with 296956 additions and 0 deletions
+34
View File
@@ -0,0 +1,34 @@
import { nextTick, unref } from 'vue'
import type { NProgressOptions } from 'nprogress'
import NProgress from 'nprogress'
import 'nprogress/nprogress.css'
import { useCssVar } from '@vueuse/core'
const primaryColor = useCssVar('--el-color-primary', document.documentElement)
export const useNProgress = () => {
NProgress.configure({ showSpinner: false } as NProgressOptions)
const initColor = async () => {
await nextTick()
const bar = document.getElementById('nprogress')?.getElementsByClassName('bar')[0] as ElRef
if (bar) {
bar.style.background = unref(primaryColor.value) as string
}
}
initColor()
const start = () => {
NProgress.start()
}
const done = () => {
NProgress.done()
}
return {
start,
done
}
}