Files
manja_dev_ui/src/main.js
T
sean bd77e1a4e7
NPM Installation / build (16.x, ubuntu-latest) (push) Has been cancelled
NPM Installation / build (16.x, windows-latest) (push) Has been cancelled
NPM Installation / build (17.x, ubuntu-latest) (push) Has been cancelled
NPM Installation / build (17.x, windows-latest) (push) Has been cancelled
NPM Installation / build (18.x, ubuntu-latest) (push) Has been cancelled
NPM Installation / build (18.x, windows-latest) (push) Has been cancelled
Ticket material
2026-07-03 16:26:00 +07:00

64 lines
1.8 KiB
JavaScript

/**
* main.js - Application Entry Point
*
* This file initializes the Vue 3 application and configures:
* - Pinia for state management
* - Vue Router for client-side routing
* - CoreUI Vue component library
* - Global icon system
* - Documentation helper components
*
* The application uses:
* - Vue 3 Composition API
* - Vite for building and development
* - CoreUI Vue components
* - Hash-based routing for static hosting compatibility
*/
import { createApp } from 'vue'
import { createPinia } from 'pinia'
import { setToken, hasToken } from '@/utils/session'
import App from './App.vue'
import router from './router'
// CoreUI Vue components and icons
import CoreuiVue from '@coreui/vue'
import CIcon from '@coreui/icons-vue'
import { iconsSet as icons } from '@/assets/icons'
// Documentation components (remove in production if not needed)
import DocsComponents from '@/components/DocsComponents'
import DocsExample from '@/components/DocsExample'
import DocsIcons from '@/components/DocsIcons'
import { CButton } from '@coreui/vue'
import { CBadge } from '@coreui/vue'
// Create Vue application instance
const app = createApp(App)
// Install plugins
app.use(createPinia()) // State management
app.use(router) // Router for SPA navigation
app.use(CoreuiVue) // CoreUI component library
app.component('CButton', CButton)
// Provide icons globally
app.provide('icons', icons)
// Register global components
app.component('CIcon', CIcon)
app.component('DocsComponents', DocsComponents)
app.component('DocsExample', DocsExample)
app.component('DocsIcons', DocsIcons)
// TODO: Hapus setelah fitur Login tersedia — token sementara untuk development
if (!hasToken()) {
setToken('UU7HVn7ECHe7MvqMTeTeEpoFdBA2wc0NHQX29WyG91fc6982')
}
// Mount application to DOM
app.mount('#app')