基于element-ui组件,用于展示多条结构类似的数据,可设置字段检索、分页、自定义条件检索等。
Table Attribute
| 参数 | 说明 | 类型 | 可选值 | 默认值 |
|---|---|---|---|---|
| api | 数据接口api地址 | api model | - | - |
| res_data_field | 后端返回的数据实体名称 | array/object | data/result | - |
| refresh | 是否刷新表格 | boolean | - | false |
| params | 检索表格的条件实体 | object | - | - |
| postfix | RESTful api请求url资源名称 | string | - | - |
| initLoad | 是否初始化表格加载 | boolean | - | - |
| searchField | 搜索字段参数名 | string | - | search |
| pageField | 页码或偏移数据条目 | string | offset/page | page |
| needSearch | 是否添加搜索过滤器 | boolean | - | false |
| selectionField | string | - | - | |
| selectionList | array | - | - | |
| paginLayout | 设置分页组件布局,子组件名用逗号分隔 | string |
prev, pager, next, jumper, ->, prev
|
"prev, pager, next" |
| expand | 可以通过该属性设置 Table 目前的展开行,需要设置 row-key 属性才能使用,该属性为展开行的 keys 数组。 | array | - | - |
Events
| 方法名 | 说明 | 参数 |
|---|---|---|
| selectEvent | 当选择项发生变化时会触发该事件 | selection, tableDataLength |
| select | 当用户手动勾选数据行的 Checkbox 时触发的事件 | row |