perf: skip props update if data object is the same
This commit is contained in:
parent
c9b33a9e69
commit
d8cda2387f
@ -468,7 +468,7 @@ export function createRenderer(options: RendererOptions) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function patchStatefulComponent(prevVNode: MountedVNode, nextVNode: VNode) {
|
function patchStatefulComponent(prevVNode: MountedVNode, nextVNode: VNode) {
|
||||||
const { childFlags: prevChildFlags } = prevVNode
|
const { data: prevData, childFlags: prevChildFlags } = prevVNode
|
||||||
const {
|
const {
|
||||||
data: nextData,
|
data: nextData,
|
||||||
slots: nextSlots,
|
slots: nextSlots,
|
||||||
@ -481,7 +481,9 @@ export function createRenderer(options: RendererOptions) {
|
|||||||
instance.$parentVNode = nextVNode as MountedVNode
|
instance.$parentVNode = nextVNode as MountedVNode
|
||||||
|
|
||||||
// Update props. This will trigger child update if necessary.
|
// Update props. This will trigger child update if necessary.
|
||||||
|
if (nextData !== prevData) {
|
||||||
updateProps(instance, nextData)
|
updateProps(instance, nextData)
|
||||||
|
}
|
||||||
|
|
||||||
// If has different slots content, or has non-compiled slots,
|
// If has different slots content, or has non-compiled slots,
|
||||||
// the child needs to be force updated. It's ok to call $forceUpdate
|
// the child needs to be force updated. It's ok to call $forceUpdate
|
||||||
|
Loading…
Reference in New Issue
Block a user