Skip to content

Commit cfd9ff2

Browse files
committed
Fix disableComponents
1 parent 09eb46b commit cfd9ff2

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/components/MarkdownRenderer.vue

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
<script setup lang="ts">
22
import type { MDXComponents, MDXModule } from '@/lib/markdown/mdx-types';
33
4-
const { markdown, disableComponents } = defineProps<{
4+
const { markdown, disableComponents = false } = defineProps<{
55
markdown: string;
66
disableComponents?: boolean;
77
}>();
@@ -12,6 +12,7 @@ import { watchImmediate } from '@vueuse/core';
1212
import { components } from '@/lib/markdown/components.tsx';
1313
import { watchImmediateAsync } from '@/lib/vue-utils';
1414
import type { compileStringAsync } from 'sass';
15+
import { computed } from 'vue';
1516
1617
async function sassCompileString(...args: Parameters<typeof compileStringAsync>) {
1718
const { compileStringAsync } = await import('sass');
@@ -41,7 +42,7 @@ await watchImmediateAsync(() => markdown, async markdown => {
4142
<template>
4243
<div class="mdx-root">
4344
<Suspense>
44-
<module.default v-if="module" :components="disableComponents ? components : {}" />
45+
<module.default v-if="module" :components="disableComponents ? {} : components" />
4546
</Suspense>
4647
</div>
4748
</template>

0 commit comments

Comments
 (0)