Code Monkey home page Code Monkey logo

tree-grid-by-vue's Introduction

tree-grid-by-vue

Image text

样例

<tree-grid  
:columns="columns"
:rowdata="data"
:needUpdate="needUpdate"
@refreshTable="refreshTable"
@uploadmodify="uploadmodify"
@uploaddelete="uploaddelete"
:treeLoading="treeLoading"


属性

#1、列属性  
columns: [
{name: 'ID', prop: 'id', width: 120},
{name: '删除', delete: true },
{name: 'name字段', prop: 'name', width: 260, isTree: true, edit: true},
{name: '操作', operate: true },
{name: 'level', prop: 'level', width: 120},
{name: 'url', prop: 'url', edit: true},
]
#2、行数据的格式  
rowdata:[{
"id": 87, //必须,唯一id。
"level": 1, //必须,哪个层级。
"parentid": 1, //必须,父层的id,若是最外层就是自己的id。
"name": "生产分析",
"url": "N/A",
"isleaf": 0
}] #3、是否接收父组件rowdata传入  
[[比如:Date.now()]每次父组件需要更新rowdata时,需要给needUpdate传入[时间戳/uuid]等来监听。] </br> :needUpdate="needUpdate" </br> #4、表格loading状态
[布尔值]
:treeLoading="treeLoading"

事件

#1、
[该函数是用来刷新表格并重新传入rowdata数据,这里还需要needUpdate。]
@refreshTable="refreshTable"
#2、
[提交修改请求,比如修改行,增加行等,uploadmodify函数的参数是一个数组 [data, successFn_callback, faildFn_callback],其中data表示修改的对象信息,data的id属性若含有'timestamp'字符,表示这是新增的行,successFn_callback和faildFn_callback需要在请求成功或者失败后调用。]
@uploadmodify="uploadmodify"
#3、
[提交删除所选行请求,uploaddelete函数的参数是一个数组 [deleteIdArray, successFn_callback, faildFn_callback],其中deleteIdArray表示待删除的id集合,successFn_callback和faildFn_callback需要在请求成功或者失败后调用。]
@uploaddelete="uploaddelete"

tree-grid-by-vue's People

Contributors

lky5230 avatar

Watchers

 avatar  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.