Fetch data and dynamically show it in the same component? #1927
Unanswered
torbentschechne
asked this question in
Help (Vue)
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
Hello,
I give Inertia a try right now and maybe my understanding is not correct or I miss something. I have a
Detail
component like this. This one has an input text for an api key and a button. Below that I want to render a list of items, when the submit call is coming back with a reponse.My PHP Controller in Laravel looks like this:
What happens now is that, the request is being made. The data is also displayed, but the route changes to
get-lists
. I thought that, when returning the same Component, Inertia detects what has changed and just refreshes the component, and is not performing a reload/redirects. I thought about returning a json response and handle the data in the onSuccess hook. But this does not work, as Inertia needs a InertiaResponse. In this case I can not built a dynamic SPA. Is my understanding wrong or do I miss something?Beta Was this translation helpful? Give feedback.
All reactions