diff --git a/resources/js/app.js b/resources/js/app.js index 669f02b..cf4f1c1 100644 --- a/resources/js/app.js +++ b/resources/js/app.js @@ -1,28 +1,24 @@ import Vue from 'vue' import VueMeta from 'vue-meta' import PortalVue from 'portal-vue' -import { App, plugin } from '@inertiajs/inertia-vue' -import { InertiaProgress } from '@inertiajs/progress/src' +import { InertiaProgress } from '@inertiajs/progress' +import { createInertiaApp } from '@inertiajs/inertia-vue' Vue.config.productionTip = false Vue.mixin({ methods: { route: window.route } }) -Vue.use(plugin) Vue.use(PortalVue) Vue.use(VueMeta) InertiaProgress.init() -const el = document.getElementById('app') - -new Vue({ - metaInfo: { - titleTemplate: title => (title ? `${title} - Ping CRM` : 'Ping CRM'), - }, - render: h => - h(App, { - props: { - initialPage: JSON.parse(el.dataset.page), - resolveComponent: name => require(`./Pages/${name}`).default, +createInertiaApp({ + resolve: name => require(`./Pages/${name}`), + setup({ el, app, props }) { + new Vue({ + metaInfo: { + titleTemplate: title => (title ? `${title} - Ping CRM` : 'Ping CRM'), }, - }), -}).$mount(el) + render: h => h(app, props), + }).$mount(el) + }, +})