Skip to content

Instantly share code, notes, and snippets.

@alexanderfriederich
Created October 19, 2022 19:27
Show Gist options
  • Save alexanderfriederich/887ecfd3ae99d54445a4126bb302d2d7 to your computer and use it in GitHub Desktop.
Save alexanderfriederich/887ecfd3ae99d54445a4126bb302d2d7 to your computer and use it in GitHub Desktop.
Trigger Inertia Visits for Vue 3 where <inertia-link> does not work
import { Inertia } from '@inertiajs/inertia';
function route(name, params) {
let my_params = params || {};
return window.route(name, {...my_params});
}
export function triggerInertiaVisit(routeName, routeParams, visitParams) {
Inertia.visit(route(routeName, routeParams), visitParams);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment