/
Codename-Nik
/
WebApp
Обзор
Документация
Войти
/
Codename-Nik
/
WebApp
Код
Запросы
0
Задачи
Вики
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
frontend/src/main.ts
107 строк
3 KB
Nikolay Pokhodnya
first commit
03 ноя 2025, 19:47
03 ноя 2025, 19:47
a9fbdee
Код
Авторство
О чём код?
import { createApp } from 'vue' import { createPinia } from 'pinia' import App from './App.vue' import router from './router' import 'vuetify/styles' import { createVuetify } from 'vuetify' import { aliases, mdi } from 'vuetify/iconsets/mdi' import * as components from 'vuetify/components' import * as directives from 'vuetify/directives' import '@mdi/font/css/materialdesignicons.css' import '@/assets/main.css' const vuetify = createVuetify({ components, directives, icons: { defaultSet: 'mdi', aliases, sets: { mdi, }, }, theme: { defaultTheme: 'light', themes: { light: { colors: { primary: '#1976D2', secondary: '#424242', accent: '#82B1FF', error: '#FF5252', info: '#2196F3', success: '#4CAF50', warning: '#FFC107', } } } }, defaults: { VBtn: { variant: 'flat', rounded: 'lg', }, VCard: { rounded: 'lg', elevation: 2, }, VTextField: { variant: 'outlined', density: 'comfortable', }, VSelect: { variant: 'outlined', density: 'comfortable', }, VTextarea: { variant: 'outlined', density: 'comfortable', }, } }) async function initializeApp() { try { const app = createApp(App) const pinia = createPinia() app.use(pinia) app.use(router) app.use(vuetify) app.config.errorHandler = (err, instance, info) => { console.error('Vue error:', err, info) // Here you can send errors to your error tracking service } app.mount('#app') const loadingElement = document.getElementById('app')?.firstElementChild if (loadingElement && loadingElement instanceof HTMLElement) { loadingElement.style.display = 'none' } console.log('🚀 TaskFlow application started successfully') } catch (error) { console.error('Failed to initialize app:', error) const appElement = document.getElementById('app') if (appElement) { appElement.innerHTML = ` <div style="display: flex; justify-content: center; align-items: center; height: 100vh; background: #f5f5f5; flex-direction: column; padding: 2rem; text-align: center;"> <h1 style="color: #d32f2f; margin-bottom: 1rem;">Ошибка загрузки</h1> <p style="color: #666; margin-bottom: 2rem;">Не удалось загрузить приложение. Пожалуйста, обновите страницу.</p> <button onclick="window.location.reload()" style="background: #1976D2; color: white; border: none; padding: 0.75rem 1.5rem; border-radius: 8px; cursor: pointer;"> Обновить страницу </button> </div> ` } } } initializeApp()