fix: maximum call stack size exceeded (#234)

This commit is contained in:
Lykin 2024-04-19 11:54:05 +08:00
parent 1bf4b0eee1
commit 974477cb49
1 changed files with 5 additions and 1 deletions

View File

@ -244,7 +244,11 @@ const useTabStore = defineStore('tab', {
if (!!!reset && typeof value === 'object') { if (!!!reset && typeof value === 'object') {
if (value instanceof Array) { if (value instanceof Array) {
tabData.value = tabData.value || [] tabData.value = tabData.value || []
tabData.value.push(...value) // direct deconstruction leads to 'Maximum call stack size exceeded'
// tabData.value.push(...value)
for (let i = 0; i < value.length; i++) {
tabData.value.push(value[i])
}
} else { } else {
tabData.value = assign(value, tabData.value || {}) tabData.value = assign(value, tabData.value || {})
} }