SolidScribe/client/src/main.js

56 lines
1.3 KiB
JavaScript
Raw Normal View History

// The Vue build version to load with the `import` command
// (runtime-only or standalone) has been set in webpack.base.conf with an alias.
2020-02-01 14:21:22 -08:00
import Vue from 'vue'
import Vuex from 'vuex'
import 'es6-promise/auto' //Vuex likes promises
import store from './stores/mainStore';
import App from './App'
import router from './router'
2020-03-25 22:05:31 -07:00
import 'fomantic-ui-css/semantic.css';
require('./assets/semantic-helper.css')
// Fonts
require('./assets/roboto-latin.woff2')
require('./assets/roboto-latin-bold.woff2')
2020-02-01 14:21:22 -08:00
require('./assets/squire.js')
//Import socket io, init using nginx configured socket path
import io from 'socket.io-client';
const socket = io({ path:'/socket' });
2020-02-01 14:21:22 -08:00
//integrate connected socket into vue instance
Object.defineProperties(Vue.prototype, {
$io: {
get: () => socket
}
})
// This callback runs before every route change, including on page load.
// Sets the title of the page using vue router
router.beforeEach((to, from, next) => {
document.title = to.meta.title + ' - Solid Scribe';
next();
});
//Attach event bus to main vue object, all components will inherit event bus
import EventBus from './EventBus'
import Helpers from './Helpers'
Vue.use(Vuex)
Vue.config.productionTip = false
2020-02-01 14:21:22 -08:00
new Vue({
el: '#app',
router,
store,
components: { App },
template: '<App/>'
})