0.1.2 • Published 1 year ago

@zybwin/tablepro v0.1.2

Weekly downloads
-
License
MIT
Repository
-
Last release
1 year ago

参数

参数说明类型默认值
tableId表格idString
loading加载框Booleanfalse
tableColumnTitles表头Array
tableDataProp表格数据Array[]
arraySpanMethod单元格合并方法Function() => {}
showSummary合计Booleanfalse
getSummaries合计方法Function默认计算一列的和
resizable表格是否可以拖动Booleanfalse
showHeader是否显示表头Booleantrue
placeholderText提示语String请输入
tableHeaderCellHeight表头单元格高度String32px
tableHeaderCellTextAlign表头文本对齐方式Stringleft
tableCellHeight单元格高度String32px
tableCellTextAlign文本对齐方式Stringleft
tableHeight表格高度String100%
columnColorArr列的颜色Function[]
cellStyle单元格方法Function() => {}
enableEdit能否编辑Booleantrue

方法

方法说明回调参数
inputChangeinput的change事件(在 Input 值改变时触发)(val, scope.$index, scope.row, scope.column)

tableDataProp 示例

tableDataProp: [
  {
    id: "1",
    name: "张三",
    age: 20,
    weight: '120'
  },
  {
    id: "2",
    name: "李四",
    age: 30,
    weight: '150'
  },
],

tableColumnTitles 示例(多表头组件)

[
  {
    label: "编号",
    prop: "id",
    width: "100px",
    // minWidth: 1,
    inputInfo: { inputCategory: "text" }, // input(默认), inputNumber, text, select, 四种值
  },
  { label: "姓名", prop: "name" },
  {
    label: "爱好",
    prop: "hobby",
    children: [
      { label: "游泳", prop: "swimming" },
      {
        label: "国家",
        prop: "country",
        options: [
          {
            optionLabel: "美国",
            optionValue: "American",
          },
          {
            optionLabel: "中国",
            optionValue: "China",
          },
          {
            optionLabel: "法国",
            optionValue: "France",
          },
        ],
        inputInfo: { inputCategory: "select" },
      },
      {
        label: "音乐",
        prop: "music",
        children: [
          {
            label: "左手",
            prop: "knight",
            children: [
              {
                label: "占比",
                prop: "zb",
                inputInfo: { inputCategory: "inputNumber", maxlength: 9 },
              },
              {
                label: "小菜",
                prop: "xc",
              },
            ],
          },
          { label: "右手", prop: "classical" },
        ],
      },
    ],
  },
]