vue-dir-tree-view

0.1.4 • Public • Published

vue-dir-tree-view

Demo

Vue directory structure plugin

Render directories with files

Icons used: bootstrap icons

npm install vue-dir-tree-view
<template>
  <VueDirTreeView :config="config" @item-click="onclick" />
</template>
import VueDirTreeView from 'vue-dir-tree-view'

export default {
components: {
    VueDirTreeView
},
data(){
    return {
        config: {
            options: null,
            data: <exampledata>
        }
    },
},
methods: {
    onclick(item){
        console.log(item)
    }
}
/*
exampledata: [
    {
        "title": "multi-depth-dir",
        "children": [
            {
                "title": "one",
                "isLeaf": false,
                "children": [
                    {"title": "image.jpg", "isLeaf": true},
                    {"title": "image.mp3", "isLeaf": true},
                    {"title": "image.mp4", "isLeaf": true},
                    {"title": "spreadsheet.xlsx", "isLeaf": true},
                    {"title": "file.pdf", "isLeaf": true}
                ]
            },
            {
                "title": "two",
                "children": [
                    {
                        "title": "three",
                        "isLeaf": false,
                        "children": [
                            {"title": "file_example_GIF_500kB.gif", "isLeaf": true},
                            {"title": "file_example_JPG_100kB.jpg", "isLeaf": true},
                            {"title": "file_example_SVG_20kB.svg", "isLeaf": true},
                            {"title": "file-sample_100kB.rtf", "isLeaf": true},
                            {"title": "file-sample_500kB.odt", "isLeaf": true}
                        ]
                    },
                    {"title": "file_example_GIF_500kB.php", "isLeaf": true},
                    {"title": "file_example_JPG_100kB.js", "isLeaf": true},
                    {"title": "file_example_PNG_500kB.pptx", "isLeaf": true},
                    {"title": "file_example_XLSX_100.xlsx", "isLeaf": true}
                ],
                "isLeaf": false
            },
            {"title": "file_example_GIF_500kB.vmv", "isLeaf": true},
            {"title": "file_example_SVG_20kB.docx", "isLeaf": true},
            {"title": "file_example_TIFF_1MB.tiff", "isLeaf": true}
        ],
        "isLeaf": false
    }
]
*/

/vue-dir-tree-view/

    Package Sidebar

    Install

    npm i vue-dir-tree-view

    Weekly Downloads

    0

    Version

    0.1.4

    License

    none

    Unpacked Size

    60 kB

    Total Files

    8

    Last publish

    Collaborators

    • jfkeci