1.1.7 • Published 4 years ago

@neotrident/neo-table v1.1.7

Weekly downloads
11
License
MIT
Repository
-
Last release
4 years ago

Table

功能列表

- 自动分页
- 手动调整列宽
- 显示或隐藏列
- 导出表格数据到csv
- 支持静态或动态绑定数据
- 通过col.type格式化列(控件包括input, date, select, radio, checkbox, inputNumber等常用组件)

更新日志

- 优化拖动性能和手感

示图

demo

安装方式

 <!--script引入 -->
 <script src="./neoTable.min.js"></script>
 
<!-- NPM 安装 -->
 npm install --save @neotrident/neo-table

示例

<script>
import neoTable from "@neotrident/neo-table"
export default {
  name: "App",
  components: {
    neoTable
  },
  data() {
    return {
      data: [
        {
          name: 'John Brown111',
          sex: 1,
          age: 18,
          merried: [],
          birthday: ''
        },
        {
          name: 'Jim Green',
          sex: 2,
          age: 24,
          merried: [],
          birthday: ''
        },
        {
          name: 'Joe Black',
          sex: -1,
          age: 30,
          merried: ['已婚'],
          birthday: '2019-09-25'
        },
        {
          name: 'Joe Black',
          sex: -1,
          age: 30,
          merried: ['已婚'],
          birthday: '2019-09-25'
        },
        {
          name: 'Joe Black',
          sex: -1,
          age: 30,
          merried: ['已婚'],
          birthday: '2019-09-25'
        }
      ],
      columns: [
        {
            type: 'selection',
            width: 60,
            align: 'center'
        },
        {
          title: '名称',
          slot: 'name',
          width:150
        },
        {
          title: '性别',
          slot: 'sex',
          type:'select',
          options:[{
            label: '男',
            value: 1
          },{
            label: '女',
            value: 2
          }]
        },
        {
          title: '年龄',
          slot: 'age',
          type: 'input',
          props: {
            number: true
          }
        },
        {
          title: '婚姻状况',
          slot: 'merried',
          type: 'checkbox',
          options:['已婚']
        },
        {
          title: '生日',
          slot: 'birthday',
          type: 'date',
          visible: true
        }
      ]
    }
  }
};
</script>

API

Table Props
属性说明类型默认值
data表格数据源Array, Function[]
mapping远程返回的数据结构的字段映射Object{rows: 'rows',total: 'total'}
resizable列宽是否可手动调整Booleanfalse
showExport是否显示导出按钮Booleanfalse
exportOpts导出方法的参数Object详细用法见iview官网
btnsTxt内置的工具栏按钮名称Array'导出', '列'
...props其余列设置,见iview官网
Column
属性说明类型默认值
visible列的显隐Booleantrue
type列的格式化类型String,可选input, date, select, radio, checkbox, inputNumber-
props列的propsObject{}
optionsselect, checkbox, radio等初始化数据Array[]
...props其余列设置,见iview官网
Slot
属性说明
tool-btns工具栏插槽
1.1.7

4 years ago

1.1.6

4 years ago

1.1.5

4 years ago

1.1.4

4 years ago

1.1.3

4 years ago

1.1.2

4 years ago

1.1.1

4 years ago

1.1.0

4 years ago

1.0.2

5 years ago

1.0.1

5 years ago

1.0.0

5 years ago