You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
812 B
JavaScript
31 lines
812 B
JavaScript
import { createApp } from 'vue'
|
|
import { createPinia } from 'pinia'
|
|
import ElementPlus from 'element-plus'
|
|
import zhCn from 'element-plus/es/locale/lang/zh-cn'
|
|
import * as ElementPlusIconsVue from '@element-plus/icons-vue'
|
|
|
|
import App from './App.vue'
|
|
import router from './router'
|
|
import { createPersistPlugin } from '@/stores/plugins/persist'
|
|
import './styles/global.scss'
|
|
import 'element-plus/dist/index.css'
|
|
|
|
const app = createApp(App)
|
|
|
|
// Pinia 实例化并注册持久化插件
|
|
const pinia = createPinia()
|
|
pinia.use(createPersistPlugin({
|
|
whiteList: ['token', 'userInfo']
|
|
}))
|
|
|
|
// 全局注册 Element Plus Icon
|
|
for (const [key, component] of Object.entries(ElementPlusIconsVue)) {
|
|
app.component(key, component)
|
|
}
|
|
|
|
app.use(pinia)
|
|
app.use(router)
|
|
app.use(ElementPlus, { locale: zhCn })
|
|
|
|
app.mount('#app')
|