Skip to content

Commit 1d346a8

Browse files
committed
docs(icons): display selected preset in theme
1 parent 1b60995 commit 1d346a8

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

docs/app/components/content/IconsTheme.vue

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,10 @@
11
<script setup lang="ts">
22
import json5 from 'json5'
3-
import icons from '../../../../src/theme/icons'
3+
import { themeIcons } from '../../utils/theme'
44
5-
const { framework } = useFrameworks()
5+
const appConfig = useAppConfig()
6+
7+
const icons = computed(() => themeIcons[appConfig.theme.icons as keyof typeof themeIcons || 'lucide'])
68
79
const { data: ast } = await useAsyncData(`icons-theme`, async () => {
810
const md = `
@@ -11,7 +13,7 @@ const { data: ast } = await useAsyncData(`icons-theme`, async () => {
1113
\`\`\`ts [app.config.ts]
1214
export default defineAppConfig(${json5.stringify({
1315
ui: {
14-
icons
16+
icons: icons.value
1517
}
1618
}, null, 2).replace(/,([ |\t\n]+[}|\])])/g, '$1')})
1719
\`\`\`\
@@ -30,7 +32,7 @@ export default defineConfig({
3032
vue(),
3133
ui(${json5.stringify({
3234
ui: {
33-
icons
35+
icons: icons.value
3436
}
3537
}, null, 2).replace(/,([ |\t\n]+[}|\])])/g, '$1')
3638
.split('\n')
@@ -43,8 +45,8 @@ export default defineConfig({
4345
::
4446
`
4547
46-
return parseMarkdown(md)
47-
}, { watch: [framework] })
48+
return parseMarkdown(md, { })
49+
}, { watch: [icons] })
4850
</script>
4951

5052
<template>

0 commit comments

Comments
 (0)