如何在TreeView中显示文件夹和文件?

时间:2018-04-03 10:42:49

标签: html css treeview jstree

我想将文件夹和文件填充到html treeview中,我想显示文件的创建日期和扩展名。我怎样才能做到这一点? 我的treeview html:

<ul>
<li>
    Main Folder
    <ul>
        <li data-jstree='{ "opened" : true }'>
            Folder 1
            <ul>
                <li data-jstree='{ "type" : "file" }'>
                    File1 - Created Date: 03_04_2018
                </li>
                <li data-jstree='{ "type" : "file" }'>
                    File2 - Created Date: 03_04_2018
                </li>
                <li data-jstree='{ "type" : "file" }'>
                    File3 - Created Date: 03_04_2018
                </li>
            </ul>
        </li>
        <li data-jstree='{ "opened" : true }'>
            Folder 2
            <ul>
                <li data-jstree='{ "type" : "file" }'>
                    File1 - Created Date: 03_04_2018
                </li>
                <li data-jstree='{ "type" : "file" }'>
                    File2 - Created Date: 03_04_2018
                </li>
                <li data-jstree='{ "type" : "file" }'>
                    File3 - Created Date: 03_04_2018
                </li>
            </ul>
        </li>
    </ul>
</li>

Treeview Screen Shot

0 个答案:

没有答案