adrema/resources/js/app.js

31 lines
848 B
JavaScript
Raw Normal View History

2020-04-10 20:32:12 +02:00
import Vue from 'vue';
import { modules, init } from 'agnoster';
import { Checkbox } from 'js-modules';
import { InertiaApp } from '@inertiajs/inertia-vue'
import store from './store.js';
import 'font-awesome/css/font-awesome.css';
2020-04-12 00:26:44 +02:00
import Echo from 'laravel-echo';
window.io = require('socket.io-client');
2020-04-10 20:32:12 +02:00
Vue.use(modules);
Vue.use(init);
Vue.use(InertiaApp);
Vue.component('checkbox', Checkbox);
const app = document.getElementById('app')
2020-04-12 00:26:44 +02:00
window.Echo = new Echo({
broadcaster: 'socket.io',
host: window.location.hostname+':'+document.querySelector('meta[name=socketport]').getAttribute('content'),
});
2020-04-10 20:32:12 +02:00
new Vue({
render: h => h(InertiaApp, {
props: {
initialPage: JSON.parse(app.dataset.page),
resolveComponent: name => require(`./views/${name}`).default,
},
}),
store
}).$mount(app)