Update app.js to use the new `createInertiaApp()` factory method

This commit is contained in:
Jonathan Reinink 2021-06-14 08:20:30 -04:00
parent d2c1bc9a0e
commit 99b88e8943
1 changed files with 12 additions and 16 deletions

20
resources/js/app.js vendored
View File

@ -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')
createInertiaApp({
resolve: name => require(`./Pages/${name}`),
setup({ el, app, props }) {
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,
},
}),
render: h => h(app, props),
}).$mount(el)
},
})