adrema/resources/js/app.js

46 lines
1.4 KiB
JavaScript
Raw Normal View History

2020-04-10 20:32:12 +02:00
import Vue from 'vue';
2022-11-17 20:56:46 +01:00
import {App as InertiaApp, plugin, Link as ILink} from '@inertiajs/inertia-vue';
2020-04-10 20:32:12 +02:00
2022-02-12 15:22:22 +01:00
import SvgSprite from './components/SvgSprite.js';
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';
2022-02-12 15:12:08 +01:00
import VPages from './components/VPages.vue';
2021-04-11 02:55:26 +02:00
import VBool from './components/VBool.vue';
2022-02-12 15:04:52 +01:00
import AppLayout from './layouts/AppLayout.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);
2022-02-12 15:22:22 +01:00
Vue.component('SvgSprite', SvgSprite);
2022-02-12 15:12:08 +01:00
Vue.component('VPages', VPages);
2021-04-11 02:55:26 +02:00
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);
2022-02-12 15:26:14 +01:00
Vue.component('ILink', ILink);
2020-04-10 20:32:12 +02:00
new Vue({
2022-11-17 20:56:46 +01:00
render: (h) =>
h(InertiaApp, {
props: {
initialPage: JSON.parse(el.dataset.page),
resolveComponent: async (name) => {
var page = (await import(`./views/${name}`)).default;
2021-04-11 11:19:55 +02:00
2022-11-17 20:56:46 +01:00
if (page.layout === undefined) {
page.layout = AppLayout;
}
return page;
},
},
}),
2021-04-10 19:45:11 +02:00
}).$mount(el);