diff --git a/components/content/ProsePre.vue b/components/content/ProsePre.vue index 62d43a0..4688d7a 100644 --- a/components/content/ProsePre.vue +++ b/components/content/ProsePre.vue @@ -28,34 +28,43 @@ const props = defineProps({ }, }); -const codeHtml = await codeToHtml(props.code.replace(/\n$/, ""), { +const isLoading = ref(true); +const codeHtml = ref(""); +codeToHtml(props.code.replace(/\n$/, ""), { lang: props.language, theme: "github-dark", +}).then((html) => { + codeHtml.value = html; + isLoading.value = false; });