Skip to content

Commit bd5f7c8

Browse files
committed
Fix infinite recursion of computed getter in vue v3.4.14
1 parent 2e424d8 commit bd5f7c8

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

packages/admin/src/components/DitoSchema.vue

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -166,7 +166,7 @@ export default DitoComponent.component('DitoSchema', {
166166
? data(this.context)
167167
: data
168168
),
169-
currentTab: null,
169+
selectedTab: null,
170170
componentsRegistry: {},
171171
panesRegistry: {},
172172
panelsRegistry: {},
@@ -195,16 +195,6 @@ export default DitoComponent.component('DitoSchema', {
195195
return getNamedSchemas(this.schema.tabs)
196196
},
197197
198-
selectedTab: {
199-
get() {
200-
return this.currentTab || this.defaultTab || null
201-
},
202-
203-
set(selectedTab) {
204-
this.currentTab = selectedTab
205-
}
206-
},
207-
208198
defaultTab() {
209199
let first = null
210200
if (this.tabs) {
@@ -376,7 +366,7 @@ export default DitoComponent.component('DitoSchema', {
376366
// handled, but remove the trailing `/create` or `/:id` from it so that
377367
// tabs informs that stay open after creation still work.
378368
if (this.hasRootTabs) {
379-
this.currentTab = hash?.slice(1) || null
369+
this.selectedTab = hash?.slice(1) || null
380370
}
381371
}
382372
},
@@ -412,6 +402,10 @@ export default DitoComponent.component('DitoSchema', {
412402
}
413403
},
414404
405+
mounted() {
406+
this.selectedTab = this.defaultTab
407+
},
408+
415409
unmounted() {
416410
this.emitEvent('destroy')
417411
this._register(false)

0 commit comments

Comments
 (0)