Created
October 19, 2022 19:27
-
-
Save alexanderfriederich/887ecfd3ae99d54445a4126bb302d2d7 to your computer and use it in GitHub Desktop.
Trigger Inertia Visits for Vue 3 where <inertia-link> does not work
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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