Browse Source

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

dev
Evan You 8 years ago
parent
commit
ced2dfc8f7
  1. 1
      .flowconfig
  2. 5
      src/core/vdom/vnode.js
  3. 2
      types/vnode.d.ts

1
.flowconfig

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

5
src/core/vdom/vnode.js

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

2
types/vnode.d.ts

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

Loading…
Cancel
Save