Resource Center Tags On Mounted
This note documents a fix applied to src/layouts/ViewResourceCenterTags.vue
to make tag-based filtering work reliably with URL query parameters and during hydration. (Should be applied to elements that depend on window resulsts)
Symptoms
- After navigation or on initial hydration, with active tag in url, the list sometimes rendered stale or empty results until interaction. Route/hydration changes did not always trigger a re-render.
Fix: Force client-side re-mount on hydration and when the query changes
ts
const renderKey = ref(0);
onMounted(() => { renderKey.value += 1; });
watch(queryTag, () => { renderKey.value += 1; });
renderKey
keys list content so it re-renders after hydration and when the active tag changes.