mirror of
https://git.meshkee.com/cssd/cssd-front.git
synced 2026-10-10 19:53:18 +03:30
- install @mdi/font and @fortawesome/fontawesome-free - move required font files to public/fonts (roboto, mdi, fontawesome) - load fonts via public/index.html instead of CDN - remove font imports from main.js
67 lines
1.3 KiB
JavaScript
67 lines
1.3 KiB
JavaScript
import Vue from 'vue';
|
|
|
|
// Components
|
|
import './components'
|
|
|
|
// Plugins
|
|
import './plugins'
|
|
import './plugins/vuetify'
|
|
|
|
// Config
|
|
import { baseUrl } from './config'
|
|
|
|
// Styles
|
|
import '@/styles/css/Assets/Main.scss'
|
|
|
|
// Sync router with store
|
|
import { sync } from 'vuex-router-sync'
|
|
// Application imports
|
|
import App from './App.vue'
|
|
import i18n from '@/i18n'
|
|
import router from '@/router'
|
|
import store from '@/store'
|
|
|
|
import VueLazyLoad from 'vue-lazyload';
|
|
Vue.use(VueLazyLoad)
|
|
import { ApiService, TokenService } from '@/services'
|
|
// Sync store with router
|
|
sync(store, router)
|
|
|
|
// Vue filter for string
|
|
Vue.filter('text_20_letter', function(value) {
|
|
if (!value) return '';
|
|
return value.slice(0, 20);
|
|
});
|
|
|
|
Vue.config.productionTip = false
|
|
ApiService.setHeader();
|
|
// Set the base URL of the API
|
|
ApiService.init(baseUrl())
|
|
|
|
require('./services/global/errorHandler.service');
|
|
// If token exists set Authorization header
|
|
if (TokenService.getToken()) {
|
|
ApiService.setAuthHeader();
|
|
|
|
// If info exists set info in Store
|
|
if (TokenService.getInfo()) {
|
|
let info = TokenService.getInfo();
|
|
store.commit('setInfo', info);
|
|
} else {
|
|
store.dispatch('info');
|
|
}
|
|
}
|
|
|
|
import hasRole from '@/services/mixin/hasRole'
|
|
Vue.mixin(hasRole)
|
|
|
|
/* eslint-disable no-new */
|
|
new Vue({
|
|
// vuetify,
|
|
i18n,
|
|
router,
|
|
store,
|
|
render: h => h(App),
|
|
iconfont: 'mdi'
|
|
}).$mount('#app');
|