mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-28 19:00:35 +01:00
docs(HighlightInlineType): use ts-type language
This commit is contained in:
@@ -5,18 +5,7 @@ const props = defineProps<{
|
|||||||
type: string
|
type: string
|
||||||
}>()
|
}>()
|
||||||
|
|
||||||
const { data: ast } = await useAsyncData<any>(`hightlight-inline-code-` + props.type, async () => {
|
const { data: ast } = await useAsyncData<any>(`hightlight-inline-code-` + props.type, () => parseMarkdown(`\`${props.type}\`{lang="ts-type"}`))
|
||||||
const ast = await parseMarkdown(`\`type _ = ${props.type}\`{lang="ts"}`)
|
|
||||||
|
|
||||||
const p = ast.body.children[0]
|
|
||||||
const code = p.children[0]
|
|
||||||
|
|
||||||
// Remove the `type _ = ` part
|
|
||||||
code.children = code.children.slice(3)
|
|
||||||
ast.body.children = [code]
|
|
||||||
|
|
||||||
return ast
|
|
||||||
})
|
|
||||||
</script>
|
</script>
|
||||||
|
|
||||||
<template>
|
<template>
|
||||||
|
|||||||
Reference in New Issue
Block a user