I was wondering if their is a alternative we can use to use the links functionality to go to different page? #1119
-
So here is what I like to do. <button @click="myFunction()">click</button> and my script for this one. export default {
methods: {
myFunction() {
axios.get('http://sample.com/checker').then(res => {
this.$router.push('/patient/5'); // this what should we do here to do this without reloading the whole page? so it works like a vue router in inertia?
})
}
}
} this is an example of my laravel web route Route::prefix('patient')->group(function () {
Route::get('/{patient}', function (\App\Models\Patient $patient) {
return Inertia::render('Patient/Show/Index', [
'data' => $patient,
]);
})->name('patient.show');
}); |
Beta Was this translation helpful? Give feedback.
Answered by
WalrusSoup
Mar 14, 2022
Replies: 1 comment 1 reply
-
With a persistent layout, Inertia.visit() should handle this runtime link generation without issue? The persistent layout should make it appear as if the page was not changed entirely. |
Beta Was this translation helpful? Give feedback.
1 reply
Answer selected by
JenuelDev
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
With a persistent layout, Inertia.visit() should handle this runtime link generation without issue? The persistent layout should make it appear as if the page was not changed entirely.