Library/frontend/src/main.js

94 lines
2.0 KiB
JavaScript
Raw Permalink Normal View History

2017-11-09 09:31:03 +00:00
// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
import Vue from 'vue'
import App from './App'
import router from './router'
2017-11-09 11:19:53 +00:00
import auth from './auth'
2017-11-09 09:31:03 +00:00
2017-11-10 13:41:57 +00:00
// Semantic UI
import '../node_modules/semantic-ui-css/semantic.min.css'
2017-11-09 15:27:43 +00:00
// Grid import
import Grid from './components/Grid'
2017-11-20 14:06:33 +00:00
// Modal import
import Modal from './components/Modal'
2017-11-09 15:27:43 +00:00
// Font-awesome icons import
2018-01-10 12:07:54 +00:00
import 'vue-awesome/icons/refresh'
import 'vue-awesome/icons/sign-out'
import 'vue-awesome/icons/trash'
import 'vue-awesome/icons/edit'
import 'vue-awesome/icons/sort-asc'
import 'vue-awesome/icons/sort-desc'
2017-11-09 13:24:59 +00:00
import Icon from 'vue-awesome/components/Icon'
2017-11-10 10:49:02 +00:00
// Paginate import
import VuePaginate from 'vue-paginate'
// Multiselect import
import Multiselect from 'vue-multiselect'
2017-11-21 15:22:52 +00:00
// Multilanguage import
import Multilanguage from 'vue-multilanguage'
import language from './lang/lang'
// Notifications
import Notifications from 'vue-notification'
2017-11-24 10:54:52 +00:00
// List Component
import List from './components/List'
// Notifications
Vue.use(Notifications)
// Multiselect globally
Vue.component('multiselect', Multiselect)
2017-11-09 15:27:43 +00:00
// Icons setup
2017-11-09 13:24:59 +00:00
Vue.component('icon', Icon)
2017-11-09 15:27:43 +00:00
2017-11-09 11:19:53 +00:00
// Check the user's auth status when the app starts
auth.checkAuth()
2017-11-09 09:31:03 +00:00
2017-11-09 15:27:43 +00:00
// Register Grid component
Vue.component('grid', Grid)
2017-11-20 14:06:33 +00:00
// Register Grid component
Vue.component('modal', Modal)
2017-11-24 10:54:52 +00:00
// List Component Setup
Vue.component('list', List)
2017-11-10 10:49:02 +00:00
// Paginate setup
Vue.use(VuePaginate)
2017-11-20 15:14:44 +00:00
// Globally set focus
Vue.directive('focus', {
// When the bound element is inserted into the DOM...
inserted: function (el) {
// Focus the element
el.focus()
}
})
2017-11-10 13:57:40 +00:00
2017-11-21 15:22:52 +00:00
// Init Multilanguage
Vue.use(Multilanguage, language)
2017-11-21 11:32:18 +00:00
/*
// Check permissions on route-level
// Passed via 'meta: {perms: ['auth', 'admin']}' on routes definition
router.beforeEach((to, from, next) => {
console.log(to)
next()
})
*/
2017-11-09 09:31:03 +00:00
/* eslint-disable no-new */
new Vue({
el: '#app',
router,
template: '<App/>',
components: { App }
})