Skip to content
This repository has been archived by the owner on Sep 6, 2021. It is now read-only.
/ v-folder Public archive

A component of vue.js@2, for tree/directory/files selection or displaying.

License

Notifications You must be signed in to change notification settings

v-comp/v-folder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

51 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

v-folder

A component made for vue@2, for tree/directory/files selection or displaying.

Note

Vue version above 2.1.5 is required.

Install

# npm
npm install --save v-folder

# or yarn
yarn add v-folder

Note that font-awsome is required.

Demo

You can run npm run dev for local preview.

For project integration, see configurations bellow:

import VFolder from 'v-folder';
Vue.use(VFolder);

new Vue({
  el: '#app',
  template: `
      <v-folder :data="data" :ajax="ajax" :conf="conf" @change="onChange"></v-folder>
  `,
  data() {
    return {
      uid: 0,
      conf: {
        // tree node name
        node: 'sourceDir',
        // KEY NAME of dirs/branches/parents etc.. .
        branch: 'dirs',
        // KEY NAME of  files/leafs/children etc...
        leaf: 'files'
      },
      data: {
        // root
        sourceDir: 'C:/Users',
        // children
        files: [],
        dirs: []
      },
      // ajax settings
      ajax: {
        method: 'GET',
        url: 'http://localhost:1234',
        params: {},
        data: {},
        headers: {},
        // params key of path
        pathAs: 'path',
        // process response data
        process: (res) => res.data
      }
    };
  },
  methods: {
    onChange(result) {
      console.log(result);
    }
  }
});

Screenshot

About

A component of vue.js@2, for tree/directory/files selection or displaying.

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published