diff --git a/packages/runtime-core/src/componentProps.ts b/packages/runtime-core/src/componentProps.ts index 58e16fe0..06d92fb8 100644 --- a/packages/runtime-core/src/componentProps.ts +++ b/packages/runtime-core/src/componentProps.ts @@ -12,6 +12,7 @@ import { } from '@vue/shared' import { warn } from './warning' import { Data, ComponentInstance } from './component' +import { FULL_PROPS } from './patchFlags' export type ComponentPropsOptions
= { [K in keyof P]: Prop
| null @@ -147,6 +148,18 @@ export function resolveProps( attrs = props } + // in case of dynamic props, check if we need to delete keys from + // the props proxy + const { patchFlag } = instance.vnode + if (propsProxy !== null && (patchFlag === 0 || patchFlag & FULL_PROPS)) { + const rawInitialProps = unwrap(propsProxy) + for (const key in rawInitialProps) { + if (!props.hasOwnProperty(key)) { + delete propsProxy[key] + } + } + } + // lock immutable lock()