first commit
This commit is contained in:
44
frontend/src/main.ts
Normal file
44
frontend/src/main.ts
Normal file
@@ -0,0 +1,44 @@
|
||||
import { createApp } from 'vue'
|
||||
import { createPinia } from 'pinia'
|
||||
import Toast from 'vue-toastification'
|
||||
import 'vue-toastification/dist/index.css'
|
||||
|
||||
import App from './App.vue'
|
||||
import router from './router'
|
||||
import './style.css'
|
||||
import { useAuthStore } from './stores/auth'
|
||||
import { useAdminStore } from './stores/admin'
|
||||
|
||||
const app = createApp(App)
|
||||
|
||||
// 配置 Pinia 状态管理
|
||||
const pinia = createPinia()
|
||||
app.use(pinia)
|
||||
|
||||
// 初始化认证状态
|
||||
const authStore = useAuthStore()
|
||||
const adminStore = useAdminStore()
|
||||
|
||||
authStore.initAuth()
|
||||
adminStore.initAuth()
|
||||
|
||||
// 配置路由
|
||||
app.use(router)
|
||||
|
||||
// 配置 Toast 通知
|
||||
app.use(Toast, {
|
||||
position: 'top-right',
|
||||
timeout: 5000,
|
||||
closeOnClick: true,
|
||||
pauseOnFocusLoss: true,
|
||||
pauseOnHover: true,
|
||||
draggable: true,
|
||||
draggablePercent: 0.6,
|
||||
showCloseButtonOnHover: false,
|
||||
hideProgressBar: false,
|
||||
closeButton: 'button',
|
||||
icon: true,
|
||||
rtl: false,
|
||||
})
|
||||
|
||||
app.mount('#app')
|
||||
Reference in New Issue
Block a user