fix(runtime-core): cache props default values to avoid unnecessary watcher trigger (#3474)
fix #3471
This commit is contained in:
@@ -302,7 +302,12 @@ export interface ComponentInternalInstance {
|
||||
* @internal
|
||||
*/
|
||||
emitted: Record<string, boolean> | null
|
||||
|
||||
/**
|
||||
* used for caching the value returned from props default factory functions to
|
||||
* avoid unnecessary watcher trigger
|
||||
* @internal
|
||||
*/
|
||||
propsDefaults: Data
|
||||
/**
|
||||
* setup related
|
||||
* @internal
|
||||
@@ -440,6 +445,9 @@ export function createComponentInstance(
|
||||
emit: null as any, // to be set immediately
|
||||
emitted: null,
|
||||
|
||||
// props default value
|
||||
propsDefaults: EMPTY_OBJ,
|
||||
|
||||
// state
|
||||
ctx: EMPTY_OBJ,
|
||||
data: EMPTY_OBJ,
|
||||
|
||||
Reference in New Issue
Block a user