Compare commits

...

5 Commits

Author SHA1 Message Date
Benjamin Canac
eb523f0171 Merge branch 'v3' into feat/detect-theme-hash 2025-02-16 16:24:01 +01:00
Benjamin Canac
d23ae6d8a5 Merge branch 'v3' into feat/detect-theme-hash 2025-02-16 14:07:37 +01:00
HugoRCD
dbed234c73 Merge remote-tracking branch 'origin/v3' into feat/detect-theme-hash 2025-02-15 19:03:30 +01:00
HugoRCD
8ffe5ca69b up 2025-02-14 22:55:26 +01:00
HugoRCD
05313dc0d4 feat(ComponentTheme): detect theme hash 2025-02-14 22:42:20 +01:00

View File

@@ -86,9 +86,11 @@ const themeLink = computed(() => {
return `https://github.com/nuxt/${repo}/blob/v3/src/theme/${slug}.ts`
})
const { data: ast } = await useAsyncData(`component-theme-${camelName}-${hash({ props })}`, async () => {
const themeHash = route.hash === '#theme'
const { data: ast } = await useAsyncData(`component-theme-${camelName}-${hash({ props, themeHash })}`, async () => {
const md = `
::code-collapse{class="nuxt-only"}
::code-collapse{class="nuxt-only" ${themeHash ? 'open' : null} }
\`\`\`ts [app.config.ts]
export default defineAppConfig(${json5.stringify(component.value, null, 2).replace(/,([ |\t\n]+[}|\])])/g, '$1')})
@@ -96,7 +98,7 @@ export default defineAppConfig(${json5.stringify(component.value, null, 2).repla
::
::code-collapse{class="vue-only"}
::code-collapse{class="vue-only" ${themeHash ? 'open' : null} }
\`\`\`ts [vite.config.ts]
import { defineConfig } from 'vite'