mirror of https://github.com/vuejs/core.git
fix(runtime-core): unset removed props first in full diff mode
fix #6571
This commit is contained in:
parent
c71a08e6fd
commit
c0d8db81a6
|
|
@ -1005,6 +1005,23 @@ function baseCreateRenderer(
|
||||||
isSVG: boolean
|
isSVG: boolean
|
||||||
) => {
|
) => {
|
||||||
if (oldProps !== newProps) {
|
if (oldProps !== newProps) {
|
||||||
|
if (oldProps !== EMPTY_OBJ) {
|
||||||
|
for (const key in oldProps) {
|
||||||
|
if (!isReservedProp(key) && !(key in newProps)) {
|
||||||
|
hostPatchProp(
|
||||||
|
el,
|
||||||
|
key,
|
||||||
|
oldProps[key],
|
||||||
|
null,
|
||||||
|
isSVG,
|
||||||
|
vnode.children as VNode[],
|
||||||
|
parentComponent,
|
||||||
|
parentSuspense,
|
||||||
|
unmountChildren
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
for (const key in newProps) {
|
for (const key in newProps) {
|
||||||
// empty string is not valid prop
|
// empty string is not valid prop
|
||||||
if (isReservedProp(key)) continue
|
if (isReservedProp(key)) continue
|
||||||
|
|
@ -1025,23 +1042,6 @@ function baseCreateRenderer(
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if (oldProps !== EMPTY_OBJ) {
|
|
||||||
for (const key in oldProps) {
|
|
||||||
if (!isReservedProp(key) && !(key in newProps)) {
|
|
||||||
hostPatchProp(
|
|
||||||
el,
|
|
||||||
key,
|
|
||||||
oldProps[key],
|
|
||||||
null,
|
|
||||||
isSVG,
|
|
||||||
vnode.children as VNode[],
|
|
||||||
parentComponent,
|
|
||||||
parentSuspense,
|
|
||||||
unmountChildren
|
|
||||||
)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
if ('value' in newProps) {
|
if ('value' in newProps) {
|
||||||
hostPatchProp(el, 'value', oldProps.value, newProps.value)
|
hostPatchProp(el, 'value', oldProps.value, newProps.value)
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue