File tree 2 files changed +15
-4
lines changed
packages/runtime-core/src
2 files changed +15
-4
lines changed Original file line number Diff line number Diff line change 1
- import { toRaw , shallowReactive } from '@vue/reactivity'
1
+ import {
2
+ toRaw ,
3
+ shallowReactive ,
4
+ trigger ,
5
+ TriggerOpTypes
6
+ } from '@vue/reactivity'
2
7
import {
3
8
EMPTY_OBJ ,
4
9
camelize ,
@@ -215,6 +220,9 @@ export function updateProps(
215
220
}
216
221
}
217
222
223
+ // trigger updates for $attrs in case it's used in component slots
224
+ trigger ( instance , TriggerOpTypes . SET , '$attrs' )
225
+
218
226
if ( __DEV__ && rawProps ) {
219
227
validateProps ( props , instance . type )
220
228
}
Original file line number Diff line number Diff line change @@ -13,7 +13,9 @@ import {
13
13
UnwrapRef ,
14
14
toRaw ,
15
15
shallowReadonly ,
16
- ReactiveFlags
16
+ ReactiveFlags ,
17
+ track ,
18
+ TrackOpTypes
17
19
} from '@vue/reactivity'
18
20
import {
19
21
ExtractComputedReturns ,
@@ -260,8 +262,9 @@ export const PublicInstanceProxyHandlers: ProxyHandler<any> = {
260
262
let cssModule , globalProperties
261
263
// public $xxx properties
262
264
if ( publicGetter ) {
263
- if ( __DEV__ && key === '$attrs' ) {
264
- markAttrsAccessed ( )
265
+ if ( key === '$attrs' ) {
266
+ track ( instance , TrackOpTypes . GET , key )
267
+ __DEV__ && markAttrsAccessed ( )
265
268
}
266
269
return publicGetter ( instance )
267
270
} else if (
You can’t perform that action at this time.
0 commit comments