diff --git a/src/client/theme-default/components/VPLocalSearchBox.vue b/src/client/theme-default/components/VPLocalSearchBox.vue index 32b68f96..8c835a98 100644 --- a/src/client/theme-default/components/VPLocalSearchBox.vue +++ b/src/client/theme-default/components/VPLocalSearchBox.vue @@ -155,6 +155,9 @@ debouncedWatch( if (canceled) return const c = new Map>() for (const { id, mod } of mods) { + const mapId = id.slice(0, id.indexOf('#')) + let map = c.get(mapId) + if (map) continue const comp = mod.default ?? mod if (comp?.render) { const app = createApp(comp) @@ -178,8 +181,6 @@ debouncedWatch( const sections = div.innerHTML.split(headingRegex) app.unmount() sections.shift() - const mapId = id.slice(0, id.indexOf('#')) - let map = c.get(mapId) if (!map) { map = new Map() c.set(mapId, map)