fix: router force update (#2914)

This commit is contained in:
Tiago Vasconcelos 2025-01-28 11:44:37 +00:00 committed by GitHub
parent 73e716085b
commit 4c7567a552
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 2 deletions

File diff suppressed because one or more lines are too long

View file

@ -9,6 +9,11 @@ const DynamicComponent = {
default: () => []
}
},
data() {
return {
keys: []
}
},
async mounted() {
await this.loadDynamicContent()
},
@ -89,7 +94,13 @@ const DynamicComponent = {
template: html // Use the fetched HTML as the template
})
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) {
console.error('Error loading dynamic content:', error)
} finally {