diff --git a/src/components/navbar.vue b/src/components/navbar.vue new file mode 100644 index 0000000..360543c --- /dev/null +++ b/src/components/navbar.vue @@ -0,0 +1,63 @@ + + + + + + + + diff --git a/src/main.ts b/src/main.ts index 26559da..bc32aee 100644 --- a/src/main.ts +++ b/src/main.ts @@ -3,18 +3,27 @@ import { createSSRApp } from 'vue' import App from './App.vue' import { requestInterceptor } from './http/interceptor' import { routeInterceptor } from './router/interceptor' +import navBar from '@/components/navbar.vue' import store from './store' import '@/style/index.scss' import 'virtual:uno.css' +import { getNavBarHeight, getCapsuleOffset } from '@/utils/index' + + export function createApp() { const app = createSSRApp(App) + /* 注册全局组件 */ + app.component('navBar', navBar) // 注册全局组件 + app.use(store) app.use(routeInterceptor) app.use(requestInterceptor) app.use(VueQueryPlugin) app.provide('OSS', 'https://shchazhi.oss-cn-hangzhou.aliyuncs.com/fronted/') + app.provide('navbarHeight', getNavBarHeight()) + app.provide('capsuleOffset', getCapsuleOffset()) return { app, diff --git a/src/utils/index.ts b/src/utils/index.ts index 540ffd0..3c16a19 100644 --- a/src/utils/index.ts +++ b/src/utils/index.ts @@ -208,4 +208,4 @@ export function getCapsuleOffset() { // #endif return rightPadding -} +} \ No newline at end of file