1.0.3 • Published 4 years ago

tree-app v1.0.3

Weekly downloads
77
License
-
Repository
github
Last release
4 years ago

tree-app

Demo

https://ishimitsu14.github.io/tree-app/

Install library

npm install --save tree-app

Then, import and register the component

import Vue from "vue";
import TreeApp from 'tree-app';
import TreeApp from 'tree-app/lib/tree-app.css';
Vue.component('tree-app', TreeApp);

Props

<tree :parent-tree="tree" :leader-list="leaderList" :is-show-controls="true"/>

Parent Tree

PropTypeExample ValueisRequired
idNumber1true
leaderIdNumber1true
nameStringJohn Conortrue
positionStringOwnertrue
numberNumber10false
second_positionStringHolderfalse
descriptionStringSome descriptionfalse
colorString#E8C567true
typeNumber1true
childrenArrayfalse
staffArrayfalse
Staff
PropTypeExample ValueisRequired
idNumber1true
srcStringhttps://i.ibb.co/6Fjxq6D/user1.jpgfalse
nameStringJessica Albatrue
phoneString+7 (999) 999-99-99true
additionalObject { label: 'Telegram', value: '+7 (999) 999-99-99' }false
Type can be: 1, 2, 3, 4, 5.
Example:
{
    id: 2,
    leaderId: 2,
    name: 'Sara Conor',
    position: 'General Manager',
    second_position: 'Leader',
    color: '#E8C567',
    type: 2,
    children: [
        {
            id: 3,
            leaderId: 3,
            name: 'Jonh Conor',
            position: 'Manager`s Assistant',
            second_position: 'Assistant Manager',
            color: '#FFFFFF',
            type: 3,
            children: [...]
            staff: [
                {
                    id: 4,
                    src: 'https://i.ibb.co/88YjHBT/user4.png',
                    name: 'Петров Иван Николаевич',
                    phone: '+7 (902) 789-09-08',
                    additional: [
                        { label: 'Telegram', value: '+7 (902) 789-09-08' },
                        { label: 'Дата рождения', value: '01.02.1998' },
                    ],
                },
            ]
        }
    ],
}

Leader List

PropTypeExample ValueisRequired
namestringJohn Conortrue
idnumber1true
Must be array, used for 'leader' in change and add modals

Event

EventReturnDescription
onReadynullEmit when component is mounted
onDeleteId of itemEmit when deleted item
onAddAdded itemEmit when added item
onEditChanged itemEmit when edited item
onUpdateTreeChanged treeEmit when tree is changed
onOpenUserProfileId of userEmit when click on user open user profile
1.0.2

4 years ago

1.0.3

4 years ago

1.0.1

4 years ago

1.0.0

4 years ago

0.2.5

4 years ago

0.2.3

4 years ago

0.2.4

4 years ago

0.2.1

4 years ago

0.2.0

4 years ago

0.1.8

4 years ago

0.1.7

4 years ago

0.1.9

4 years ago

0.1.4

4 years ago

0.2.2

4 years ago

0.1.6

4 years ago

0.1.3

4 years ago

0.1.2

4 years ago

0.1.1

4 years ago

0.1.0

4 years ago