Class: NodeModel
节点模型
Constructors
new NodeModel()
new NodeModel(
schema
,parent
):NodeModel
Parameters
schema
parent
null
| NodeModel
Returns
Defined in
packages/core/src/models/node.ts:86
Properties
__VTJ_NODE__
readonly
__VTJ_NODE__:boolean
=true
标记
Defined in
packages/core/src/models/node.ts:29
children
children:
string
|JSExpression
|NodeModel
[] =''
子节点
Defined in
packages/core/src/models/node.ts:59
directives
directives:
DirectiveModel
[] =[]
指令
Defined in
packages/core/src/models/node.ts:79
disposed
disposed:
boolean
=false
销毁标识
Defined in
packages/core/src/models/node.ts:84
events
events:
Record
<string
,EventModel
> ={}
节点事件
Defined in
packages/core/src/models/node.ts:74
from
readonly
from:NodeFrom
组件来源
Defined in
packages/core/src/models/node.ts:51
id
readonly
id:string
节点唯一标识
Defined in
packages/core/src/models/node.ts:43
invisible
invisible:
boolean
=false
是否不可见
Defined in
packages/core/src/models/node.ts:55
locked
locked:
boolean
=false
锁定
Defined in
packages/core/src/models/node.ts:34
name
readonly
name:string
名称,即组件的名称或html的标签名
Defined in
packages/core/src/models/node.ts:47
parent
parent:
null
|NodeModel
=null
Defined in
packages/core/src/models/node.ts:88
props
props:
Record
<string
,PropModel
> ={}
节点属性
Defined in
packages/core/src/models/node.ts:69
slot?
optional
slot:NodeSlot
放置在父组件的插槽
Defined in
packages/core/src/models/node.ts:64
nodes
static
nodes:Record
<string
,NodeModel
> ={}
记录所有节点的实例
Defined in
packages/core/src/models/node.ts:39
Methods
appendChild()
appendChild(
node
,silent
):void
追加子节点
Parameters
node
silent
boolean
= false
Returns
void
Defined in
packages/core/src/models/node.ts:293
dispose()
dispose(
silent
):void
销毁
Parameters
silent
boolean
= false
Returns
void
Defined in
packages/core/src/models/node.ts:416
getPropValue()
getPropValue(
name
):JSONValue
|JSExpression
|JSFunction
获取属性值
Parameters
name
string
Returns
JSONValue
| JSExpression
| JSFunction
Defined in
packages/core/src/models/node.ts:195
insertAfter()
insertAfter(
node
,silent
):void
在当前节点的后面插入节点
Parameters
node
silent
boolean
= false
Returns
void
Defined in
packages/core/src/models/node.ts:313
insertBefore()
insertBefore(
node
,silent
):void
在当前节点的前面插入节点
Parameters
node
silent
boolean
= false
Returns
void
Defined in
packages/core/src/models/node.ts:332
isChild()
isChild(
node
):boolean
Parameters
node
Returns
boolean
Defined in
packages/core/src/models/node.ts:472
lock()
lock(
silent
):void
Parameters
silent
boolean
= false
Returns
void
Defined in
packages/core/src/models/node.ts:436
moveNext()
moveNext(
silent
):void
Parameters
silent
boolean
= false
Returns
void
Defined in
packages/core/src/models/node.ts:360
movePrev()
movePrev(
silent
):void
Parameters
silent
boolean
= false
Returns
void
Defined in
packages/core/src/models/node.ts:345
removeChild()
removeChild(
node
,silent
):void
删除子节点
Parameters
node
silent
boolean
= false
Returns
void
Defined in
packages/core/src/models/node.ts:275
removeDirective()
removeDirective(
dirctive
,silent
):void
删除指令
Parameters
dirctive
silent
boolean
= false
Returns
void
Defined in
packages/core/src/models/node.ts:257
removeEvent()
removeEvent(
name
,silent
):void
删除事件
Parameters
name
string
silent
boolean
= false
Returns
void
Defined in
packages/core/src/models/node.ts:223
removeProp()
removeProp(
name
,silent
):void
删除属性
Parameters
name
string
silent
boolean
= false
Returns
void
Defined in
packages/core/src/models/node.ts:183
setChildren()
setChildren(
children
,silent
):void
设置子节点
Parameters
children
string
| JSExpression
| NodeSchema
[]
silent
boolean
= false
Returns
void
Defined in
packages/core/src/models/node.ts:128
setDirective()
setDirective(
scheam
,silent
):void
新增或更新指令
Parameters
scheam
NodeDirective
| DirectiveModel
silent
boolean
= false
Returns
void
Defined in
packages/core/src/models/node.ts:235
setEvent()
setEvent(
scheam
,silent
):void
新增或更新事件
Parameters
scheam
silent
boolean
= false
Returns
void
Defined in
packages/core/src/models/node.ts:206
setProp()
setProp(
name
,value
,defaultValue
?,silent
?):void
新增或更新属性
Parameters
name
string
value
JSONValue
| JSExpression
| JSFunction
defaultValue?
JSONValue
| JSExpression
| JSFunction
silent?
boolean
= false
Returns
void
Defined in
packages/core/src/models/node.ts:161
setSlot()
setSlot(
slot
?,silent
?):void
设置节点放置的插槽
Parameters
slot?
string
| NodeSlot
silent?
boolean
= false
Returns
void
Defined in
packages/core/src/models/node.ts:147
setVisible()
setVisible(
visible
,silent
):void
Parameters
visible
boolean
silent
boolean
= false
Returns
void
Defined in
packages/core/src/models/node.ts:460
toDsl()
toDsl():
NodeSchema
获取DSL
Returns
Defined in
packages/core/src/models/node.ts:380
unlock()
unlock(
silent
):void
Parameters
silent
boolean
= false
Returns
void
Defined in
packages/core/src/models/node.ts:448
update()
update(
schema
,silent
):void
更新节点属性
Parameters
schema
Partial
<NodeSchema
>
silent
boolean
= false
是否静默,静默更新即不触发事件
Returns
void
Defined in
packages/core/src/models/node.ts:102