diff --git a/packages/runtime-core/src/vnode.ts b/packages/runtime-core/src/vnode.ts index 57c0cf8b7d2..2f463a4ad74 100644 --- a/packages/runtime-core/src/vnode.ts +++ b/packages/runtime-core/src/vnode.ts @@ -642,11 +642,25 @@ function _createVNode( ) } +function generateProps(props: Data & VNodeProps) { + const target: Data & VNodeProps = {} + for (const key in props) { + if (isProxy(props[key])) { + target[key] = extend({}, props[key]) + } else { + target[key] = props[key] + } + } + return target +} + export function guardReactiveProps( props: (Data & VNodeProps) | null, ): (Data & VNodeProps) | null { if (!props) return null - return isProxy(props) || isInternalObject(props) ? extend({}, props) : props + return isProxy(props) || isInternalObject(props) + ? extend({}, generateProps(props)) + : props } export function cloneVNode(