chore: add key to vnode

This commit is contained in:
zernonia 2024-03-14 13:58:35 +08:00
parent b2e0522b59
commit 2e23d7f511

View File

@ -6,7 +6,12 @@ export default defineComponent(
const { codeConfig } = useConfigStore()
return () => {
const clonedVNode = slots.default?.()?.[0] ? cloneVNode(slots.default?.()?.[0]) : undefined
const clonedVNode = slots.default?.()?.[0]
? cloneVNode(slots.default?.()?.[0], {
key: JSON.stringify(codeConfig.value),
})
: undefined
// @ts-expect-error cloneVNode
const preVNode = [...clonedVNode?.children].find((node: VNode) => node.type === 'pre') as VNode
// @ts-expect-error cloneVNode