mirror of
https://github.com/ArthurDanjou/ui.git
synced 2026-01-16 21:18:05 +01:00
36 lines
676 B
Vue
36 lines
676 B
Vue
<script setup lang="ts">
|
|
import json5 from 'json5'
|
|
|
|
const appConfig = useAppConfig()
|
|
const { $prettier } = useNuxtApp()
|
|
|
|
const { data: ast } = await useAsyncData(`icons-theme`, async () => {
|
|
const md = `
|
|
\`\`\`ts [app.config.ts]
|
|
export default defineAppConfig({
|
|
ui: {
|
|
icons: ${json5.stringify(appConfig.ui.icons, null, 2)}
|
|
}
|
|
})
|
|
\`\`\`\
|
|
`
|
|
|
|
let formatted = ''
|
|
try {
|
|
formatted = await $prettier.format(md, {
|
|
trailingComma: 'none',
|
|
semi: false,
|
|
singleQuote: true
|
|
})
|
|
} catch (e) {
|
|
formatted = md
|
|
}
|
|
|
|
return parseMarkdown(formatted)
|
|
})
|
|
</script>
|
|
|
|
<template>
|
|
<MDCRenderer v-if="ast" :body="ast.body" :data="ast.data" />
|
|
</template>
|