遇到一个jsTree节点添加自定义属性的问题的 在节点中添加"a_attr":{"href":"qwqwe"} 就可以了
demo
[
"Simple root node",
{
"text" : "井田模型管理列表",
"type":"root",
"state" : {
"opened" : true,
"selected" : true
},
"children" : [
{
"text" : "三采区" ,
"children":[
{
"text" : "工作面1",
"type":"file",
"a_attr":{"data-id":"工作面1(三采区)"}//关键在这里
}
]
},
{
"text" : "四采区" ,
"children":[
{
"text" : "工作面1",
"type":"file",
"a_attr":{"data-id":"工作面1(四采区)"}//关键在这里
}
]
}
]
}
]
效果
原文:https://blog.csdn.net/qq_34626185/article/details/78906758