0
4

1 回答 1

0

您可以将 expand 作为节点项的属性包括在内,如下所示:

{  
    "data":{  
        "name":"Home",
        "size":"20kb",
        "type":"Folder"
    },
    "children":[  
        {  
            "data":{  
                "name":"Invoices",
                "size":"20kb",
                "type":"Text"
            },
            expanded: true
        }
    ],
    expanded: true
}

树表使用以下节点接口:

export interface TreeNode {
    data?: any;
    children?: TreeNode[];
    leaf?: boolean;
    expanded?: boolean;
}

https://www.primefaces.org/primeng/#/treetable

于 2019-03-08T01:05:16.560 回答