Skip to content

EyTable表格(推荐使用)

常规演示

基础表格如下

api:设置一个promise并输出列表,默认会传入page、page_size作为参数,若需要修改字段和额外参数请见useTable详情

columns:设置列,基础字段为 titledataIndexshowType,用于展示对应的文字、字段和展示类型。详情

columns.showType: 设置表格类型,详情

不同renderKey类型演示

column.renderKey: 如下,不同的renderKey展示不同类型输入选项,默认为renderInput

column.customForm: form中若需要自定义插槽,则设置customForm:true此时插槽名称为对应的dataIndex

API

Attributes

成员说明类型默认值
apiapi 请求接口(data: unknown) => Promise<unknown>() => {}
columns表格项设置EyColumnItem[][]
hooksConfiguserTable 的配置IUseTableOptions<any, any>{}
tablePropsa-table 自带属性TableProps{}

ColumnItem

columns字段本身保留了ant-design-vue中table里columns的所有字段,以下是对一些特殊字段的说明

此处会有较多字段,是为了降低使用者心智负担将form中字段集成于此,当showType为form或者both时可以当作使用ey-form的item配置

成员说明类型默认值
renderKey表单要渲染的元素renderKey
formatter要转化输出的值formatterKey | ((data: unknown) => unknown)
formProps对应 ant-design-vue 中 form-item 的值FormItemProps
optionsey-select 中的 options 选项,同 el-props.optionsSelectProps['options']
component渲染的组件类型string | Component
elProps对于 renderKey 元素的属性T
colPropsgrid 布局时可使用ColProps
colDouble默认布局时使用双倍的 col 值boolean
dependformitem 的依赖项(FormGroupItemDepend: TFormGroupItemDepend, deps: unknown[]) => void
showType当前项展示的类型'column' | 'form' | 'both'
title必填选项,对应的 form.label 或表格显示string
dataIndex必填选项,对应的 form.value 或表格字段string
customForm自定义 form 插槽boolean

一个让开发效率增倍的组件库