Skip to content

Commit 2f1834d

Browse files
authored
fix: dynamic load parser in MDC component (#363)
1 parent b722c4a commit 2f1834d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/runtime/components/MDC.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,6 @@
2121
import { useAsyncData } from 'nuxt/app'
2222
import { watch, computed, type PropType } from 'vue'
2323
import type { MDCParseOptions } from '@nuxtjs/mdc'
24-
import { parseMarkdown } from '../parser'
2524
2625
const props = defineProps({
2726
tag: {
@@ -87,6 +86,7 @@ const { data, refresh, error } = await useAsyncData(key.value, async () => {
8786
if (typeof props.value !== 'string') {
8887
return props.value
8988
}
89+
const { parseMarkdown } = await import('@nuxtjs/mdc/runtime')
9090
return await parseMarkdown(props.value, {
9191
...props.parserOptions,
9292
toc: props.partial ? false : props.parserOptions?.toc,

0 commit comments

Comments
 (0)