File tree 3 files changed +8
-4
lines changed
3 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -1148,6 +1148,7 @@ defineComponent({
1148
1148
this . $on ( 'foo' , ( ) => { } )
1149
1149
this . $ssrContext
1150
1150
this . $isServer
1151
+ this . $children [ 0 ] . $root . $children
1151
1152
return h ( 'div' , { } , [ ...this . $slots . default ! ] )
1152
1153
}
1153
1154
} )
Original file line number Diff line number Diff line change @@ -16,6 +16,7 @@ class Test extends Vue {
16
16
this . $isServer
17
17
this . $ssrContext
18
18
this . $vnode
19
+ this . $root . $children [ 0 ] . $children [ 0 ]
19
20
}
20
21
21
22
// test property reification
Original file line number Diff line number Diff line change @@ -35,6 +35,8 @@ export interface CreateElement {
35
35
) : VNode
36
36
}
37
37
38
+ type NeverFallback < T , D > = [ T ] extends [ never ] ? D : T
39
+
38
40
export interface Vue <
39
41
Data = Record < string , any > ,
40
42
Props = Record < string , any > ,
@@ -47,10 +49,10 @@ export interface Vue<
47
49
// properties with different types in defineComponent()
48
50
readonly $data : Data
49
51
readonly $props : Props
50
- readonly $parent : Parent extends never ? Vue : Parent
51
- readonly $root : Root extends never ? Vue : Root
52
- readonly $children : Children extends never ? Vue [ ] : Children
53
- readonly $options : ComponentOptions < Vue >
52
+ readonly $parent : NeverFallback < Parent , Vue >
53
+ readonly $root : NeverFallback < Root , Vue >
54
+ readonly $children : NeverFallback < Children , Vue [ ] >
55
+ readonly $options : NeverFallback < Options , ComponentOptions < Vue > >
54
56
$emit : Emit
55
57
56
58
// Vue 2 only or shared
You can’t perform that action at this time.
0 commit comments