29 lines
874 B
JavaScript
29 lines
874 B
JavaScript
import 'nprogress/nprogress.css'; // 默认样式,可根据需要自定义样式
|
||
import './assets/main.css'
|
||
import { createApp } from 'vue'
|
||
import { createPinia } from 'pinia'
|
||
import App from './App.vue'
|
||
import router from './router'
|
||
import 'vant/lib/index.css';
|
||
import { useSEO } from './composables/useSEO'
|
||
|
||
const app = createApp(App)
|
||
app.use(createPinia())
|
||
app.use(router)
|
||
|
||
app.mount('#app')
|
||
|
||
// 在应用挂载后初始化SEO功能,确保路由已准备好
|
||
router.isReady().then(() => {
|
||
const { updateSEOByRoute } = useSEO()
|
||
})
|
||
|
||
document.addEventListener('DOMContentLoaded', () => {
|
||
const loadingElement = document.getElementById('app-loading');
|
||
if (loadingElement) {
|
||
loadingElement.style.opacity = '0';
|
||
setTimeout(() => {
|
||
loadingElement.parentNode.removeChild(loadingElement);
|
||
}, 500); // 动画过渡时间
|
||
}
|
||
}); |