minor tweaks to how JS is set up

This commit is contained in:
2022-06-29 13:46:07 -06:00
parent dabcb49292
commit 0e88b9b198
3 changed files with 20 additions and 14 deletions

View File

@ -1,14 +1,15 @@
require("./bootstrap");
import { createApp, h } from "vue";
import { createInertiaApp } from "@inertiajs/inertia-vue3";
import { InertiaProgress } from "@inertiajs/progress";
import Notifications from "notiwind";
import { createApp, h } from 'vue';
import { createInertiaApp } from '@inertiajs/inertia-vue3';
import { InertiaProgress } from '@inertiajs/progress';
import { ZiggyVue } from '../../vendor/tightenco/ziggy/dist/vue.m';
import Notifications from 'notiwind';
const appName = window.document.getElementsByTagName("title")[0]?.innerText || "Laravel";
const appName = window.document.getElementsByTagName('title')[0]?.innerText || 'Laravel';
window.genUid = function () {
return [...Array(16)].map(() => Math.floor(Math.random() * 16).toString(16)).join("");
return [...Array(16)].map(() => Math.floor(Math.random() * 16).toString(16)).join('');
};
createInertiaApp({
@ -18,6 +19,7 @@ createInertiaApp({
return createApp({ render: () => h(app, props) })
.use(plugin)
.use(Notifications)
.use(ZiggyVue, Ziggy)
.mixin({ methods: { route } })
.mount(el);
},

View File

@ -23,5 +23,9 @@ window.axios.defaults.headers.common['X-Requested-With'] = 'XMLHttpRequest';
// broadcaster: 'pusher',
// key: process.env.MIX_PUSHER_APP_KEY,
// cluster: process.env.MIX_PUSHER_APP_CLUSTER,
// forceTLS: true
// wsHost: import.meta.env.MIX_PUSHER_HOST ?? `ws-${import.meta.env.MIX_PUSHER_CLUSTER}.pusher.com`,
// wsPort: import.meta.env.MIX_PUSHER_PORT ?? 80,
// wssPort: import.meta.env.MIX_PUSHER_PORT ?? 443,
// forceTLS: (import.meta.env.MIX_PUSHER_SCHEME ?? 'https') === 'https',
// enabledTransports: ['ws', 'wss'],
// });