fix(runtime-core): track access to $attrs

fix #1346
This commit is contained in:
Evan You
2020-06-12 16:59:15 -04:00
parent 91fa52850a
commit 6abac87b3d
2 changed files with 15 additions and 4 deletions

View File

@@ -1,4 +1,9 @@
import { toRaw, shallowReactive } from '@vue/reactivity'
import {
toRaw,
shallowReactive,
trigger,
TriggerOpTypes
} from '@vue/reactivity'
import {
EMPTY_OBJ,
camelize,
@@ -215,6 +220,9 @@ export function updateProps(
}
}
// trigger updates for $attrs in case it's used in component slots
trigger(instance, TriggerOpTypes.SET, '$attrs')
if (__DEV__ && rawProps) {
validateProps(props, instance.type)
}