Skip to content

Commit f5aa821

Browse files
authored
fix: stops props.data rerendering ContentRenderer (#3544)
1 parent b724b04 commit f5aa821

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/runtime/components/ContentRenderer.vue

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -101,10 +101,11 @@ const data = computed(() => {
101101
const proseComponentMap = Object.fromEntries(['p', 'a', 'blockquote', 'code', 'pre', 'code', 'em', 'h1', 'h2', 'h3', 'h4', 'h5', 'h6', 'hr', 'img', 'ul', 'ol', 'li', 'strong', 'table', 'thead', 'tbody', 'td', 'th', 'tr', 'script'].map(t => [t, `prose-${t}`]))
102102
103103
const { mdc } = useRuntimeConfig().public || {}
104+
const propsDataMDC = computed(() => props.data.mdc)
104105
const tags = computed(() => ({
105106
...mdc?.components?.prose && props.prose !== false ? proseComponentMap : {},
106107
...mdc?.components?.map || {},
107-
...toRaw(props.data?.mdc?.components || {}),
108+
...toRaw(propsDataMDC.value?.components || {}),
108109
...props.components,
109110
}))
110111

0 commit comments

Comments
 (0)