ensure same-template views refresh data after route change

This commit is contained in:
lightling 2024-04-10 18:22:58 -04:00
parent 39276736da
commit eb0ddfcc1e

View file

@ -22,6 +22,7 @@ let routeConfig = routeStore._routes[currentRoute.path]
let rememberWarning = false
const ready = ref(false)
const firstInit = ref(false)
const acknowledged = ref(false)
const storageId = ref('')
const warning = ref({} as WarningModal)
@ -83,7 +84,7 @@ const refresh = async () => {
top: 0,
})
ready.value = true
setTimeout(() => ready.value = true)
}
const onAcknowledgedWarning = () => {
@ -106,6 +107,7 @@ const handlePageClosed = async (scriptUrl?: string) => {
onMounted(async () => {
await refresh()
firstInit.value = true
determineGlobalStylesheets()
router.afterEach(async (to, from) => {
const oldUrl = routeConfig.scriptUrl
@ -118,7 +120,7 @@ onMounted(async () => {
<template lang="pug">
#main-container
header(
v-if='ready && !!globalConfig.header'
v-if='firstInit && !!globalConfig.header'
)
ul
HeaderLink(