adrema/resources/js/app.js

46 lines
1.3 KiB
JavaScript
Raw Normal View History

2020-04-10 20:32:12 +02:00
import Vue from 'vue';
2022-02-12 01:31:01 +01:00
import { App as InertiaApp, plugin, Link } from '@inertiajs/inertia-vue';
2021-04-11 00:57:47 +02:00
import Sprite from './components/Sprite.js';
2020-04-10 20:32:12 +02:00
2021-04-10 19:45:11 +02:00
import FText from './components/FText.vue';
2021-04-11 20:35:18 +02:00
import FSwitch from './components/FSwitch.vue';
2021-04-11 11:19:55 +02:00
import FSelect from './components/FSelect.vue';
2021-04-11 17:37:26 +02:00
import FTextarea from './components/FTextarea.vue';
2021-04-11 02:55:26 +02:00
import Pages from './components/Pages.vue';
import VBool from './components/VBool.vue';
2021-04-11 11:19:55 +02:00
import App from './layouts/App.vue';
2022-02-12 01:31:01 +01:00
import VTooltip from 'v-tooltip';
import hasModule from './mixins/hasModule.js';
2020-04-10 20:32:12 +02:00
2022-02-12 01:31:01 +01:00
Vue.use(plugin);
2021-08-22 16:49:38 +02:00
Vue.use(VTooltip);
2021-04-10 19:45:11 +02:00
Vue.component('f-text', FText);
2021-04-11 20:35:18 +02:00
Vue.component('f-switch', FSwitch);
2021-04-11 11:19:55 +02:00
Vue.component('f-select', FSelect);
2021-04-11 17:37:26 +02:00
Vue.component('f-textarea', FTextarea);
2021-04-11 00:57:47 +02:00
Vue.component('sprite', Sprite);
2021-04-11 02:55:26 +02:00
Vue.component('pages', Pages);
Vue.component('v-bool', VBool);
2020-04-10 20:32:12 +02:00
2022-02-12 01:31:01 +01:00
const el = document.getElementById('app');
2020-04-12 00:26:44 +02:00
Vue.mixin(hasModule);
Vue.component('Link', Link);
2020-04-10 20:32:12 +02:00
new Vue({
2021-04-11 11:19:55 +02:00
render: h => h(InertiaApp, {
props: {
initialPage: JSON.parse(el.dataset.page),
resolveComponent: name => {
var page = require(`./views/${name}`).default;
if (page.layout === undefined) {
page.layout = App;
}
return page;
}
},
}),
2021-04-10 19:45:11 +02:00
}).$mount(el);