Closed Wesley-Sinde closed 1 year ago
Can you provide a minimal reproduction?
@Wesley-Sinde
try to change this return h(link, this.$slots.default);
to this return h(this.item.href ? link : 'a', {}, this.$slots)
You can replace the default router-link
with inertia-link
:
import { InertiaLink, createInertiaApp } from "@inertiajs/inertia-vue3";
import { createApp, h } from "vue";
import { resolvePageComponent } from "laravel-vite-plugin/inertia-helpers";
const appName =
window.document.getElementsByTagName("title")[0]?.innerText || "Laravel";
createInertiaApp({
title: (title) => `${title} - ${appName}`,
resolve: (name) =>
resolvePageComponent(
`./Pages/${name}.vue`,
import.meta.glob("./Pages/**/*.vue")
),
setup({ el, app, props, plugin }) {
return createApp({ render: () => h(app, props) })
.use(plugin)
.component("inertia-link", InertiaLink)
.component("router-link", {
props: ["to", "custom"],
template: `<inertia-link :href="to"><slot/></inertia-link>`,
})
.mount(el);
},
});
And use :link-component-name="'inertia-link'"
.
I have an issue with this package when i am using it in inertia, the link doesn't work despite using the example given in your docs. kindly show me a detailed example on how to use this package in inertia, Here is my component
I have used this in my main js
what is missing here?