fix(topstrip): wrap breadcrumb-current in ClientOnly

The breadcrumb's trailing span pulls its label from pageBreadcrumbTitle,
which pages set in script setup after a useFetch. SSR rendered the URL
slug there; client rendered the title; Vue logged a hydration text
mismatch on every detail page.

Wrap the last segment's span in ClientOnly with an nbsp fallback so the
SSR DOM stays the same shape but defers the text to the client. The
prior attempt at this in layouts/default.vue + layouts/admin.vue was
reverted on this branch — it changed segment counts and produced a
worse node-structure mismatch.
This commit is contained in:
Jennie Robinson Faber 2026-05-19 10:33:26 +01:00
parent 397c00125a
commit 2a66b0eb8a

View file

@ -12,7 +12,12 @@
class="breadcrumb-link"
>{{ crumb.label }}</NuxtLink
>
<span v-else class="breadcrumb-current">{{ crumb.label }}</span>
<ClientOnly v-else>
<span class="breadcrumb-current">{{ crumb.label }}</span>
<template #fallback>
<span class="breadcrumb-current">&nbsp;</span>
</template>
</ClientOnly>
</template>
</span>
</slot>