1.0.11 • Published 2 years ago

kingbase-sqledittable v1.0.11

Weekly downloads
-
License
MIT
Repository
-
Last release
2 years ago

kingbase-sqledittable使用简介:

一、columns属性:

  1. action: false -- 下拉框升序、降序排列,筛选内容(文字式)
  2. fixed: false -- 固定列的位置,缩小间距后其他列被重叠到下层
  3. key: "sid" -- 列索引
  4. sortable: true -- 启用升序、降序排列(箭头式)
  5. title: "序号" -- 标题文本
  6. type:
  • "number" -- 数据类型:
  • “text”:文本(默认类型);
  • “number”:数字;
  • “date”:日期(yyyy-mm-dd hh-mm-ss);
  • "select":带复选框(尽量不使用); 7、width: 100 -- 列表宽度(单位:像素)

二、父级响应事件:

  1. edit:编辑单元格(每次编辑或undo(ctrl + z)、redo(ctrl + y)均会向父级提交编辑事件,并提交编辑数据);
    var params = {
        rowIndex,行索引
        column,列索引
        oldContent,更改前值
        newContent,更新值
    }
  1. sort:排序(表头点击“正序”、“逆序”按钮后会向父级提交“sort”事件,但不会改变表内数据排序);
    var params = {
        column,列头数据信息
        sort,排序方向:“asc”:升序;“desc”:降序;
    }

三、使用注意事项:

  1. 表头绑定数据:columns、表绑定数据:data,已不需要先赋初始值“[]”,可以直接给具体赋值。示例:
data() {
    return {
        columns: [
            {
                key: 'rowindex',
                type: 'rowindex',
                width: 40,
            },
            {
                title: '序号',
                key: 'sid',
                fixed: false,
                type: 'number',
                sortable: true,
                width: 100,
            },
            {
                title: '姓名',
                key: 'name',
                fixed: false,
                sortable: true,
                width: 120,
            }
        ],
        data: [
            {
                sid: 1,
                name: 'Jack Chen',
                sex: '男',
                age: 22,
                degree: '本科',
            },
            {
                sid: 2,
                name: 'Ross',
                sex: '女',
                age: 16,
                degree: '博士',
            },
            {
                sid: 3,
                name: 'Green',
                sex: '男',
                age: 30,
                degree: '大专',
            }
        ],
    }
}
  1. 表头绑定数据:columns,需要给第一列预设值,表绑定数据:data 才会根据该列自动赋值补齐。示例:
{
    key: "rowindex",
    type: "rowindex",
    width: 40,
},
1.0.11

2 years ago

1.0.9

2 years ago

1.0.8

2 years ago

1.0.7

2 years ago

1.0.6

2 years ago

1.0.5

2 years ago

1.0.10

2 years ago

1.0.4

2 years ago

1.0.3

2 years ago

1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago