Giter Club home page Giter Club logo

drag-hierarchy's Introduction

可拖拽排序视系图

示例:

1706782115426

使用简洁,示例如下:

<HierarchyView
  options={options}
  levelNames={[]}
  disEdit={disEdit}
  onSave={
    disEdit
    ? undefined
    : (nodes, levelNames) => {
       }
    }
/>

参数:

参数 说明 备注
options {rowId: string, children:string[],title:string,pid:string,pathId:string[]}[]
带有层级关系的一维数组。是所有节点信息的集合
详情看下表
levelNames string[]
一个字符串数组。表示每个层级的自定义name。初始化为空,自行构造name.
disEdit bool
是否禁止编辑。通常是指预览模式
onSave function
保存回调函数。将获得2个值(nodes,levelNames) 分别为节点数组和层级name数组

options参数说明:

参数 说明 类型
rowId 表示每个节点的唯一标识。 string
children 该节点的所有直系子节点的rowId。 string[]
title 该节点的展示的label。 string
pid 如果该节点有父节点,那么则表示其父节点的rowId。 string
pathId 表示该节点的关联路径,例如[根,祖,父,己]的节点rowId集合。 string[]

drag-hierarchy's People

Contributors

jilei6 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.