Replies: 1 comment 1 reply
-
Perhaps try |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
So, I am trying to embrace the new
+layout
and.data
functionality, and most of if works quite well, but I am running into a (maybe mental) brick wall concerning the following problem. I have a semi-complex route consisting of/cloud/[...id]
which shows an overview over a cloud service and/cloud/[..id]/configuration
which can be used to edit its configuration. I use the following files (edited for brevity):(I am running in a non-SSR context)
cloud/[...id]/+layout.ts
(to fetch the cloud service data for the current id)cloud/[...id]/+layout.svelte
to render a "top bar" with a breadcrumb and a tab barcloud/[...id]/+page.svelte
renders the cloud service overviewcloud/[...id]/configuration/+page.svelte
renders the edit pageWhat I want to achieve is that as soon as I click on save, that the name of the cloud service updates accordingly in the UI. However, I cannot get this to work.
Changing the data with bindings on the input field changes the contents of the
data
on the current (configuration) page, but not the data inside$page
.If then navigate to the overview, it at least changes the contents on $page and the contents that is rendered within
cloud/[...id]/+page.svelte
updates, but the contents within thecloud/[...id]/+layout.svelte
(the top bar) stays the same.Do I somehow need to trigger the load again? But fetching this from the server would be unnecessary since I already have the recent information on the return of the
updateCloudService
call. Maybe I need a store to handle this? I would appreciate some points on this, as I am probably doing something fundamentally wrong here.PS: The whole code is also available here clouditor/clouditor-medina-ui#173
Beta Was this translation helpful? Give feedback.
All reactions