Skip to content

Commit

Permalink
expose vnode.child for backwards compat, update .flowconfig & ts types
Browse files Browse the repository at this point in the history
  • Loading branch information
yyx990803 committed Jan 12, 2017
1 parent 30258a9 commit ced2dfc
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 1 deletion.
1 change: 1 addition & 0 deletions .flowconfig
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down
5 changes: 5 additions & 0 deletions src/core/vdom/vnode.js
Original file line number Diff line number Diff line change
Expand Up @@ -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 = () => {
Expand Down
2 changes: 1 addition & 1 deletion types/vnode.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ export interface VNode {
context?: Vue;
key?: string | number;
componentOptions?: VNodeComponentOptions;
child?: Vue;
componentInstance?: Vue;
parent?: VNode;
raw?: boolean;
isStatic?: boolean;
Expand Down

0 comments on commit ced2dfc

Please sign in to comment.