diff --git a/apps/www/.vitepress/theme/components/ComponentPreview.vue b/apps/www/.vitepress/theme/components/ComponentPreview.vue
index 3f2a09ab..cc42bd56 100644
--- a/apps/www/.vitepress/theme/components/ComponentPreview.vue
+++ b/apps/www/.vitepress/theme/components/ComponentPreview.vue
@@ -22,7 +22,7 @@ const props = withDefaults(defineProps<{
const { style, codeConfig } = useConfigStore()
-const codeString = ref('')
+const rawString = ref('')
const codeHtml = ref('')
function transformImportPath(code: string) {
@@ -34,8 +34,8 @@ function transformImportPath(code: string) {
watch([style, codeConfig], async () => {
try {
- codeString.value = await import(`../../../src/lib/registry/${style.value}/example/${props.name}.vue?raw`).then(res => transformImportPath(res.default.trim()))
- codeHtml.value = await codeToHtml(codeString.value, {
+ rawString.value = await import(`../../../src/lib/registry/${style.value}/example/${props.name}.vue?raw`).then(res => res.default.trim())
+ codeHtml.value = await codeToHtml(transformImportPath(rawString.value), {
lang: 'vue',
theme: cssVariables,
})
@@ -72,8 +72,8 @@ watch([style, codeConfig], async () => {