You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have used Inerita for a while and now trying to migrate to version 1.0.0. I follow the docs but I always get blank page. There is no <div id="app"> tag in the body (checked in FF and Chrome).
I use Composition API with script setup in every Vue component.
It seems like some problem in Vue render method. Vue instance is present in devtools and I am able to show something like that without render method: template: <div>Hello</div>
import { createApp } from 'layout';
createApp({});
index.ts - my custom layout package
import { createInertiaApp } from '@inertiajs/vue2';
import AxiosPlugin from './plugins/axios';
import ZiggyPlugin from './plugins/ziggy';
import Vue, { Component } from 'vue';
import Vuetify from 'vuetify';
import BaseLayout from './components/templates/BaseLayout.vue';
/**
* It creates a Vue app with Inertia, Axios, and Vuetify
* @param {object} options - object - This is an object that will be passed to the Vue instance.
* @param {Component} CustomLayout - This is the layout component that will be used for all pages.
* @param {string} [appElementId=app] - The id of the element that the app will be mounted to.
*/
export function createApp(
options: object,
CustomLayout: Component = BaseLayout,
appElementId: string = 'app'
) {
AxiosPlugin.initInterceptors();
Vue.use(Vuetify);
Vue.use(ZiggyPlugin);
const vuetify = new Vuetify({
theme: {
dark: localStorage.getItem('vuetify-dark') === 'true',
},
});
createInertiaApp({
id: appElementId,
resolve: (name) => {
if (name.startsWith('layout::')) {
return import(`./components/pages/${name.slice(8)}`);
} else {
return import(`@/components/pages/${name}`).then(({ default: page }) => {
if (page.layout === undefined) {
page.layout = CustomLayout;
}
return page;
});
}
},
setup({ el, app, props, plugin }) {
Vue.use(plugin);
new Vue(Object.assign({
vuetify,
// template: '<div>Template</div>',
render: (h) => h(app, props),
})).$mount(el)
},
});
}
The text was updated successfully, but these errors were encountered:
Version:
@inertiajs/vue2
version: 1.0.0inertiajs\inertia-laravel
version: 0.6.9laravel/framework
version: 9.48.0laravel/mix
version 6.0.43vue
version: 2.7.14typescript
version: 4.9.4Describe the problem:
I have used Inerita for a while and now trying to migrate to version 1.0.0. I follow the docs but I always get blank page. There is no
![image](https://user-images.githubusercontent.com/77578136/213418802-ade048d9-2ddc-47ec-8456-bcc3c4bf7769.png)
<div id="app">
tag in the body (checked in FF and Chrome).I use Composition API with script setup in every Vue component.
It seems like some problem in Vue render method. Vue instance is present in devtools and I am able to show something like that without render method:
template: <div>Hello</div>
Steps to reproduce:
master.blade.php - default in Inertia middleware
app.ts - entry point of application
index.ts - my custom layout package
The text was updated successfully, but these errors were encountered: