Evan You
9 years ago
19 changed files with 214 additions and 106 deletions
@ -1,10 +0,0 @@ |
|||
declare class Vue { |
|||
_render: Function; |
|||
} |
|||
|
|||
declare interface VNode { |
|||
tag: ?string; |
|||
text: ?string; |
|||
data: ?Object; |
|||
children: ?Array<VNode>; |
|||
} |
@ -1,8 +1,15 @@ |
|||
import Vue from './instance/index' |
|||
import config from './config' |
|||
import { initGlobalAPI } from './global-api/index' |
|||
|
|||
initGlobalAPI(Vue) |
|||
|
|||
// defining $isServer flag here because flow cannot handle
|
|||
// Object.defineProperty getters
|
|||
Object.defineProperty(Vue.prototype, '$isServer', { |
|||
get: () => config._isServer |
|||
}) |
|||
|
|||
Vue.version = '2.0.0-alpha.0' |
|||
|
|||
export default Vue |
|||
|
@ -1,14 +1,25 @@ |
|||
export default function VNode (tag, data, children, text, elm, ns, context) { |
|||
return { |
|||
tag, |
|||
data, |
|||
children, |
|||
text, |
|||
elm, |
|||
ns, |
|||
context, |
|||
key: data && data.key |
|||
import type Vue from 'core/instance/index' |
|||
|
|||
export default class VNode { |
|||
tag: string | void; |
|||
data: Object | void; |
|||
children: Array<VNode> | void; |
|||
text: string | void; |
|||
elm: Element | void; |
|||
ns: string | void; |
|||
context: Vue | void; |
|||
key: string | number | void; |
|||
|
|||
constructor (tag, data, children, text, elm, ns, context) { |
|||
this.tag = tag |
|||
this.data = data |
|||
this.children = children |
|||
this.text = text |
|||
this.elm = elm |
|||
this.ns = ns |
|||
this.context = context |
|||
this.key = data && data.key |
|||
} |
|||
} |
|||
|
|||
export const emptyVNode = VNode(undefined, undefined, undefined, '') |
|||
export const emptyVNode = new VNode(undefined, undefined, undefined, '') |
|||
|
Loading…
Reference in new issue