Skip to content

Commit b744188

Browse files
authored
Fix component with children in MarkdowView (#2444)
1 parent dbdd72a commit b744188

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

spx-gui/src/components/common/markdown-vue/MarkdownView.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -276,6 +276,10 @@ function renderHastElement(element: hast.Element, components: Components, key?:
276276
props = hastProps2VueProps(element.properties)
277277
children = element.children.map((c, i) => renderHastNode(c, components, i))
278278
}
279+
// There's issue when children of custom component (for exmaple `DefinitionOverviewWrapper`) updated: the component will not be notified,
280+
// here we use random key to force re-render the component as a workaround.
281+
// TODO: check https://github.com/goplus/builder/pull/2433 and remove this workaround.
282+
key = key + '' + Math.random()
279283
return h(type, { ...props, key }, children)
280284
}
281285

0 commit comments

Comments
 (0)