element select 自动展开_element tree树组件default-expanded-keys属性设置默认展开的节点...

default-expanded-keys值可以设置指定节点展开关闭状态

html代码:

:data="speNodeData"

:expand-on-click-node="true"

:check-on-click-node="true"

node-key="id"

ref="tree"

accordion

:default-expand-all="false"

default-expanded-keys="['a123','b123']"

:highlight-current="true"

:props="defaultProps"

@node-click="clickNode">

数据结构:

[

{

"id":"a123",

"label":"树1",

"isNode":null,

"moduleId":null,

"relationType":null,

"ralationTypeId":null,

"orderNum":0,

"parentId":null,

"children":[]

},

{

"id":"b123",

"label":"树2",

"isNode":null,

"moduleId":null,

"relationType":null,

"ralationTypeId":null,

"orderNum":0,

"parentId":null,

"children":[]

}

]

效果图:

你可能感兴趣的:(element,select,自动展开)