File tree Expand file tree Collapse file tree 1 file changed +10
-7
lines changed
Expand file tree Collapse file tree 1 file changed +10
-7
lines changed Original file line number Diff line number Diff line change @@ -134,19 +134,22 @@ export default {
134134 },
135135 created () {
136136 this .domainStore = store .getters .domainStore
137- // When the route changes from /domain/:id to /domain or vice versa, the component is not destroyed and created again
138- // So, we need to watch the route params to fetch the data again to update the component
139- this .$watch (
140- () => this .$route .params .id ,
141- this .fetchData ,
142- { immediate: true }
143- )
137+ this .fetchData ()
144138 eventBus .on (' refresh-domain-icon' , () => {
145139 if (this .$showIcon ()) {
146140 this .fetchData ()
147141 }
148142 })
149143 },
144+ watch: {
145+ ' $route' (to, from) {
146+ // When the route changes from /domain/:id to /domain or vice versa, the component is not destroyed and created again
147+ // So, we need to watch the route params to fetch the data again to update the component
148+ if (to .path .startsWith (' /domain' ) && from .params .id !== to .params .id ) {
149+ this .fetchData ()
150+ }
151+ }
152+ },
150153 provide () {
151154 return {
152155 parentCloseAction: this .closeAction ,
You can’t perform that action at this time.
0 commit comments