docs(ComponentCard): add code prop to key to prevent duplicates

This commit is contained in:
Benjamin Canac
2023-11-15 11:11:25 +01:00
parent 60fa2beed0
commit 7c1052f3f7

View File

@@ -247,7 +247,7 @@ function renderObject (obj: any) {
const shikiHighlighter = useShikiHighlighter({})
const codeHighlighter = async (code: string, lang: string, theme: any, highlights: number[]) => shikiHighlighter.getHighlightedAST(code, lang, theme, { highlights })
const { data: ast } = await useAsyncData(
`${name}-ast-${JSON.stringify({ props: componentProps, slots: props.slots })}`,
`${name}-ast-${JSON.stringify({ props: componentProps, slots: props.slots, code: props.code })}`,
async () => {
let formatted = ''
try {