fix: router force update (#2914)
This commit is contained in:
+1
-1
File diff suppressed because one or more lines are too long
@@ -9,6 +9,11 @@ const DynamicComponent = {
|
|||||||
default: () => []
|
default: () => []
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
data() {
|
||||||
|
return {
|
||||||
|
keys: []
|
||||||
|
}
|
||||||
|
},
|
||||||
async mounted() {
|
async mounted() {
|
||||||
await this.loadDynamicContent()
|
await this.loadDynamicContent()
|
||||||
},
|
},
|
||||||
@@ -89,7 +94,13 @@ const DynamicComponent = {
|
|||||||
template: html // Use the fetched HTML as the template
|
template: html // Use the fetched HTML as the template
|
||||||
})
|
})
|
||||||
delete window[logicKey] //dont need this anymore
|
delete window[logicKey] //dont need this anymore
|
||||||
this.$forceUpdate()
|
console.log(
|
||||||
|
`Component '${this.$route.name}' loaded. Keys: ${this.keys}`
|
||||||
|
)
|
||||||
|
if (!this.keys.includes(this.$route.name)) {
|
||||||
|
this.keys.push(this.$route.name)
|
||||||
|
this.$forceUpdate()
|
||||||
|
}
|
||||||
} catch (error) {
|
} catch (error) {
|
||||||
console.error('Error loading dynamic content:', error)
|
console.error('Error loading dynamic content:', error)
|
||||||
} finally {
|
} finally {
|
||||||
|
|||||||
Reference in New Issue
Block a user