UNPKG

w-vue-middle

Version:

统一公共服务组件

44 lines (36 loc) 1.91 kB
# 表格 ## 基础用法 ## 多级表头 ## Attributes | 参数 | 说明 | 类型 | 可选值 | 默认值 | | - | - | - | - | - | | request | 请求方法,支持get和post | Function | —— | —— | | req-body | post请求方式中的formData | Object | —— | —— | | request-immediately | 表格渲染后是否立即请求 | Boolean | —— | true | | columns | 列 | Array | —— | —— | | pagination | 分页 | Boolean/String | simple, true, false | true | | pageSizes | 分页数列表 | Array | —— | [10, 20, 30, 40, 50] | | data | 请求数据,request和data只能使用一个 | Array/Object | —— | —— | ## Columns | 参数 | 说明 | 类型 | 可选值 | 默认值 | | - | - | - | - | - | | text | 表头显示名称 | String | —— | —— | | field | 字段名 | String | —— | —— | | type | 列类型,当type=mobile,该列会会默认将手机号中间的4位用*代替 | String | checkbox, index, mobile, multiColumn(多级表头) | —— | | width | 列宽 | String | —— | —— | | minWidth | 最小列宽 | String | —— | —— | | align | 列的对齐方式 | Array/Object | left, right, center | left | | fixed | 列是否固定在左侧或者右侧,true 表示固定在左侧 | Boolean/String | true, left, right | —— | | render | 自定义渲染方式 | Function(h, param) | —— | —— | | sortable | 列支持是否支持排序 | Boolean | —— | false | ## Events | 事件名 | 说明 | 回调参数 | | - | - | - | | request-complete | 当请求完成后触发的事件 | isSuccess | | sort-change | sort值改变时 | { column, prop, order } | ## Methods | 事件名 | 说明 | 回调参数 | | - | - | - | | load | 根据参数重新请求数据 | —— | | refresh | 刷新当前页数据 | —— | | getSelections | 获取选中的列 | {rows, ids} |