初始化仓库
This commit is contained in:
31
src/main.ts
Normal file
31
src/main.ts
Normal file
@ -0,0 +1,31 @@
|
||||
import { VueQueryPlugin } from '@tanstack/vue-query'
|
||||
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,
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user