File tree 5 files changed +12
-8
lines changed
platforms/web/runtime/components
5 files changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -3,7 +3,7 @@ import { getRealChild } from 'core/vdom/helpers'
3
3
4
4
export default {
5
5
name : 'keep-alive' ,
6
- _abstract : true ,
6
+ abstract : true ,
7
7
props : {
8
8
child : Object
9
9
} ,
Original file line number Diff line number Diff line change @@ -10,8 +10,8 @@ export function initLifecycle (vm: Component) {
10
10
11
11
// locate first non-abstract parent
12
12
let parent = options . parent
13
- if ( parent && ! options . _abstract ) {
14
- while ( parent . $options . _abstract && parent . $parent ) {
13
+ if ( parent && ! options . abstract ) {
14
+ while ( parent . $options . abstract && parent . $parent ) {
15
15
parent = parent . $parent
16
16
}
17
17
parent . $children . push ( vm )
@@ -154,7 +154,7 @@ export function lifecycleMixin (Vue: Class<Component>) {
154
154
vm . _isBeingDestroyed = true
155
155
// remove self from parent
156
156
const parent = vm . $parent
157
- if ( parent && ! parent . _isBeingDestroyed && ! vm . $options . _abstract ) {
157
+ if ( parent && ! parent . _isBeingDestroyed && ! vm . $options . abstract ) {
158
158
remove ( parent . $children , vm )
159
159
}
160
160
// teardown watchers
Original file line number Diff line number Diff line change @@ -137,13 +137,17 @@ function prepatch (
137
137
vnode : MountedComponentVNode
138
138
) {
139
139
const options = vnode . componentOptions
140
- vnode . child = oldVnode . child
141
- vnode . child . _updateFromParent (
140
+ const child = vnode . child = oldVnode . child
141
+ child . _updateFromParent (
142
142
options . propsData , // updated props
143
143
options . listeners , // updated listeners
144
144
vnode , // new parent vnode
145
145
options . children // new children
146
146
)
147
+ // always update abstract components.
148
+ if ( child . $options . abstract ) {
149
+ child . $forceUpdate ( )
150
+ }
147
151
}
148
152
149
153
function insert ( vnode : MountedComponentVNode ) {
Original file line number Diff line number Diff line change @@ -66,7 +66,7 @@ function applyNS (vnode, ns) {
66
66
// we want to recrusively retrieve the real component to be rendered
67
67
export function getRealChild ( vnode : ?VNode ) : ?VNode {
68
68
const compOptions = vnode && vnode . componentOptions
69
- if ( compOptions && compOptions . Ctor . options . _abstract ) {
69
+ if ( compOptions && compOptions . Ctor . options . abstract ) {
70
70
return getRealChild ( compOptions . propsData && compOptions . propsData . child )
71
71
} else {
72
72
return vnode
Original file line number Diff line number Diff line change @@ -39,7 +39,7 @@ export function extractTransitionData (comp: Component): Object {
39
39
export default {
40
40
name : 'transition' ,
41
41
props : transitionProps ,
42
- _abstract : true ,
42
+ abstract : true ,
43
43
render ( h : Function ) {
44
44
let children = this . $slots . default
45
45
if ( ! children ) {
You can’t perform that action at this time.
0 commit comments