expose vnode.child for backwards compat, update .flowconfig & ts types

This commit is contained in:
Evan You 2017-01-12 18:04:36 -05:00
parent 30258a9a60
commit ced2dfc8f7
3 changed files with 7 additions and 1 deletions

View File

@ -11,6 +11,7 @@
flow
[options]
unsafe.enable_getters_and_setters=true
module.name_mapper='^compiler/\(.*\)$' -> '<PROJECT_ROOT>/src/compiler/\1'
module.name_mapper='^core/\(.*\)$' -> '<PROJECT_ROOT>/src/core/\1'
module.name_mapper='^shared/\(.*\)$' -> '<PROJECT_ROOT>/src/shared/\1'

View File

@ -48,6 +48,11 @@ export default class VNode {
this.isCloned = false
this.isOnce = false
}
// DEPRECATED: alias for componentInstance for backwards compat.
get child (): Component | void {
return this.componentInstance
}
}
export const createEmptyVNode = () => {

2
types/vnode.d.ts vendored
View File

@ -17,7 +17,7 @@ export interface VNode {
context?: Vue;
key?: string | number;
componentOptions?: VNodeComponentOptions;
child?: Vue;
componentInstance?: Vue;
parent?: VNode;
raw?: boolean;
isStatic?: boolean;