vnode
其他
2019-08-02 13:14:41
阅读次数: 0
获取vnode对象
- vm.$slots对象下的所有值
- vm.$scopedSlots对象的值返回一个函数,该函数执行后返回vnode对象
- directives自定义指令中钩子函数的参数3和参数4,例如钩子函数bind:
bind: function (el, binding, vnode, oldVnode) { ... )
- render渲染函数的参数1是一个返回vnode的函数,例如这里的参数h:
render: function (h) { ... }
————————————————————————————————————————————————————
vnode构造函数传参
tag?: string,
data?: VNodeData,
children?: ?Array
,
text?: string,
elm?: Node,
context?: Component,
componentOptions?: VNodeComponentOptions,
asyncFactory?: Function
————————————————————————————————————————————————————
vnode对象的属性
this.tag = tag
this.data = data
this.children = children
this.text = text
this.elm = elm
this.ns = undefined
this.context = context
- rendered in this component's scope(在此组件的范围内呈现)
this.fnContext = undefined
- real context vm for functional nodes(功能节点的实上下文虚拟机)
this.fnOptions = undefined
this.fnScopeId = undefined
- functional scope id support(功能范围ID支持)
this.key = data && data.key
this.componentOptions = componentOptions
this.componentInstance = undefined
this.parent = undefined
- component placeholder node(组件占位符节点)
this.raw = false
- contains raw HTML? (server only)(包含原始HTML)
this.isStatic = false
- hoisted static node(吊装静节点)
this.isRootInsert = true
- necessary for enter transition check(输入转换检查所必需的)
- empty comment placeholder?(空注释占位符)
this.isCloned = false
- is a cloned node?(是克隆的节点)
this.isOnce = false
this.asyncFactory = asyncFactory
- async component factory function(异步组件工厂函数)
this.isAsyncPlaceholder = false
转载自www.cnblogs.com/qq3279338858/p/11287888.html