UI: Fix domain view when opening details for a specific domainid (#10245)

This commit is contained in:
Vishesh 2025-01-30 20:25:17 +05:30 committed by GitHub
parent c70e4e29be
commit 0fbf6379f9
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

View File

@ -56,6 +56,7 @@
:loading="loading" :loading="loading"
:tabs="$route.meta.tabs" /> :tabs="$route.meta.tabs" />
<tree-view <tree-view
v-else
:key="treeViewKey" :key="treeViewKey"
:treeData="treeData" :treeData="treeData"
:treeSelected="treeSelected" :treeSelected="treeSelected"
@ -140,6 +141,15 @@ export default {
} }
}) })
}, },
watch: {
'$route' (to, from) {
// When the route changes from /domain/:id to /domain or vice versa, the component is not destroyed and created again
// So, we need to watch the route params to fetch the data again to update the component
if (to.path.startsWith('/domain') && from.params.id !== to.params.id) {
this.fetchData()
}
}
},
provide () { provide () {
return { return {
parentCloseAction: this.closeAction, parentCloseAction: this.closeAction,