1.4.6-beat4 • Published 5 months ago

edit-table-vue3 v1.4.6-beat4

Weekly downloads
-
License
ISC
Repository
-
Last release
5 months ago

edit-table-vue3

Description

基于 vue3 的可编辑表格

Params

参数说明类型默认值
dataSource(v-model)表格数据[object, object, ...][]
columns(v-model)表格列columns[]
border是否显示边框booleantrue
rowKey行唯一 keystringid
rowSelection选择行配置rowSelection-
defaultRowData编辑表格行默认数据Object-
menus自定义右键菜单menus-
wrapMenusClassName右键菜单外层容器样式名string-
keepLastRowEmpty保持表格最后一行为空数据booleanfalse
resizeCol手动调整列宽booleanfalse
showRowIndex是否显示行号booleanfalse
showRowDrag是否开启拖拽行功能booleanfalse
dargRowEnd拖拽行完成后回调Function-
showColDrag是否开启拖拽列功能booleanfalse
dargColEnd拖拽列完成后回调Function-
stickyHead表头是否启用粘性booleanfalse
stickyIndex行号是否启用粘性booleanfalse
readonly只读模式,或者指定行为只读模式boolean | [key1, key2, ...]false
disabled禁用模式,或者指定行为禁用模式boolean | [key1, key2, ...]false
openVirtualScroll是否开启虚拟滚动boolean \| VirtualScrollPropsfalse
relateRowChosed是否启动关联表格选择行,开启时,表格内容的选择行将与行选择 checkbox 联动booleanfalse
customRow行属性配置(record: Record, index: number) => ({ disabled, onclick, .... }), 函数返回内容同and design vue-
customCell单元格属性配置(record: Record, column: Column, index: number) => ({ disabled, onclick, .... }), 函数返回内容同and design vue-
customEditer编辑项配置customEditer-
selectedStyleBorderWidth选择边框宽度string1px
selectedStyleBorderColor选择边框颜色stringrgba(0, 127, 255, 0.5)
lang语言配置zh_CN、en_US、ru_RUzh_CN
messageConfig文案配置JSONmessageConfig
openUndo是否启用撤销、重做booleantrue
rules表格数据验证Rule 、Rule[]-
fastKeyboard快捷键配置, 没有配置时,将根据菜单项进行匹配是否启用某个快捷操作FastKeyboard[]-
checkNoRepaeatRowKey是否开启自动检测是否含有相同key的行数据(性能考虑,非必要不打开)boolean-
rowAutoHeight行高度是否根据内容自动调整,设置为true时,虚拟滚动将失效boolean-
pagination分页器,参考配置项或 pagination文档,设为 false 时不展示和进行分页PaginationProps \| boolean-
stripe是否为斑马纹 tableboolean-
block是否为块级,设置为true时, table 元素 width将会是铺满宽度;boolean-
serviceSorter使用服务端排序,设置为true时,排序将触发change事件boolean-
loading是否处于加载数据状态boolean-
sortCallback排序完成后回调,注意:服务端排序将不进行回调(sortOrder: boolean \|'ascend'\|'descend', column: Column, record: Record) => void-

columns

参数说明类型默认值
title表头文字string-
dataIndex列字段 keystring
type表格列单元格内容类型text | select | checkboxtext
valueType列的数据类型,在复制粘贴时,如果想不丢失数据类型,请配置此项string | number | booleanstring
options当 type 为 select 时,下拉选择项{label, value}[]-
slotName列插槽名--
width列默认宽度number`-
minWidth列最小宽度number-
rules列数据验证Rule 、Rule[]-
fixed是否固定列boolean | 'left' | 'right'false
tooltip是否开启 Tooltipbooleanfalse
autoTooltip开启自动判断溢出时才显示 Tooltip, 开启 Tooltip 时有效booleantrue
sortOrder排序方式(受控)false、ascend 、 descend-
sorter打开排序,可以自定义本地sort排序函数boolean、(a: Record, b: Record) => numberfalse
sortCallback排序完成后回调,注意:服务端排序将不进行回调(sortOrder: boolean \|'ascend'\|'descend', column: Column, record: Record) => void-
customCopy自定义复制,返回的字符串将被decode,传回customPaste回调的参数中({value, rowindex, record, source}, { rowindexs, columns, records, source }) => string-
customPaste自定义粘贴({value, rowindex, record, source}, { rowindexs, columns, records, source }) => void-
precision定义数据精度,数据会进行自动补0number \| ((data: { column: Column, record: Record, rowindex: number }) => number)-
filterMultiple是否多选booleanfalse
filters表头的筛选菜单项{label: string, value: string \| number}[]-
filteredValue筛选的受控属性,外界可用此控制列的筛选状态,值为已筛选的 value 数组(string \| number)[]-
readonly列是否只读,配置为true时,不允许修改、粘贴、删除单元格boolean-
disabled列是否禁用,配置为true时,不允许修改、粘贴、删除单元格boolean-

rowSelection

参数说明类型默认值
fixed把选择框列固定在左边booleanfalse
selectedRowKeys指定选中项的 key 数组,需要和 onChange 进行配合string[][]
disableSelectedRowKeys指定禁止选择的 key 数组string[][]
onChange选中项发生变化时的回调(selectedRowKeys, selectedRows) => void-
onSelect用户手动选择/取消选择某行的回调(record, selected, selectedRows) => void-
onSelectAll用户手动选择/取消选择所有行的回调(selected, selectedRowKeys, selectedRows) => void-

menus

参数说明类型默认值
key菜单项唯一标识string-
label菜单文案string、 VNode-
hide菜单项是否隐藏boolean(menu, {rowindexs, columns, records, source}) => boolean-
disabled菜单项是否禁用(menu, {rowindexs, columns, records, source}) => boolean-
handlerBefore菜单项点击前回调函数,如返回 reject 的 promise 将阻止菜单执行(menu, {rowindexs, columns, records, source}) => void-
handler菜单项点击回调(menu, {rowindexs, columns, records, source}) => void-
handlerAfter菜单项点击点击后回调函数(menu) => void-
input是否含输入框boolean-
inputDefaultValue输入框默认值number1
inputPrecision输入框精度number0
validator输入框验证函数((menu, { rowindexs, columns, records, source}) => Promise<string>)-
inputProps输入框 props同and design vue,inputNumber组件props参数-

customEditer

参数说明类型默认值
singleSelectRow是否只能单选行boolean-
singleSelectCell是否只能单选格boolean-
disabledSelectTh是否禁止选择表头boolean-
disabledSelectCell是否禁止选择单元格boolean-
disabledSelectRow是否禁止选择行boolean-
disabledOuterClickClearSelected是否禁止表格区域外点击清除选区boolean-
selectedRowKeys指定选中行的 key 数组 (受控)string[]-
onSelected选中表格内容时回调, 比如单元格单选、复选、框选、行选、全选等回调({rowindexs, columns, records, source}) => void-
onEditBefore编辑前回调函数,比如删除单元格数据、编辑单元格数据、删除行等,若返回Promise.reject, 将阻止更改数据({rowindexs, columns, records, source}) => void \| Promise<any>-
onDeleteBefore删除前回调函数,比如删除单元格数据、删除行等,若返回Promise.reject, 将阻止删除数据({rowindexs, columns, records, source}) => void \| Promise<any>-
onChange单元格内容 change 回调,同 input 的 onchange({newValue, oldValue, column, record, rowindex}) => void-
onBlur单元格编辑失焦回调,同 input 的 onblur({newValue, oldValue, column, record, rowindex}) => void-
onFocus单元格内容开始编辑回调({value, column, record, rowindex}) => void-
onClear删除单元格内容回调(data: {newValue, oldValue, column, record}[]) => void-
onRemove删除行回调() => void-
onSelectedAllHandel全选,在onSelected回调触发前调用(TABLE: TABLE) => void-

VirtualScrollProps

参数说明类型默认值
oneDataHeight一条数据内容的高度,在开启虚拟滚动时至关重要number24
scrollLastFlag是否向外触发滚动至底事件(scroll-last)Booleanfalse
scrollFlag是否向外触发滚动事件(scroll),会传出滚动的位移Booleanfalse
visibleBeforeCount屏幕上方留几条缓冲数据Number10
visibleAfterCount屏幕下方留几条缓冲数据Number10

Rule

参数说明类型默认值
field验证的字段路径,同column的dataIndex,如果配置在column中,则无需配置此值string 、 string[]-
trigger验证时机,默认submit'selected'、'blur' 、'change'、'submit'submit
len字符最大长度number-
min最小值number-
max最大值number-
message错误提示文案string-
pattern自定义正则验证RegExp-
required必填boolean-
precision数字最大精度number-
validator自定义验证({rule, value, record, rowindex}, (filedList?: FieldPath[], rowindex?: number) => Promise ) => Promise<unkonw>-

FastKeyboard

参数说明
Ctrl_C开启复制快捷键
Ctrl_V开启粘贴快捷键
Ctrl_Z开启撤销快捷键
Ctrl_Y开启重做快捷键
Delete开启删除快捷键(删除单元格、删除行)

messageConfig

{
  "menus": {
    "copyLabel": "复制",
    "paetsLabel": "粘贴",
    "undoLabel": "撤销 (Ctrl + Z)",
    "redoLabel": "恢复 (Ctrl + Y)",
    "copyDownLabel": "向下填充-复制",
    "addStepDownLabel": "向下填充-递增",
    "insertBeforeLabel": "上方插入[input]行",
    "insertAfterLabel": "下方插入[input]行",
    "insertAfterCopyLabel": "向下复制[input]行",
    "deleteRowsLabel": "删除选中行"
  },
  "input": {
    "mustInt": "只能输入整数",
    "maxDecimal": "只能输入[]位小数"
  },
  "disabledMoreArea": "不能对多重选择区域执行此操作"
}

slots

名称说明
headerSelect表头选择插槽
headerRowindex表头行号插槽
headerCell表头插槽
head- column.slotName 指定表头插槽
bodyCell表格内容
rowSelect表格行行选择插槽
rowindex表格行行号插槽
summary扩展表格底部

组件

名称说明
edit-table-input文本输入
edit-table-input-number数字输入
edit-table-select表格下拉组件
edit-table-select-simple表格下拉组件,只是简单的下拉, 没有复杂的交互,关注性能时优先使用此组件
edit-table-summary-row扩展表格行
edit-table-summary-cell扩展单元格,当没有指定colindex(number)时,将不能使用选择、复制功能。

事件

参数说明类型默认值
afterInsertEmptyRow插入新数据回调函数(rowindex: number, record ) => void-
warning错误信息回调(msg: string) => void-
change分页、排序、筛选变化时触发Function(pagination, filters, sorter, { currentDataSource })-

方法

参数说明类型默认值
validate验证指定列(字段)数据(filedList?: FieldPath[], rowindex?: number) => Promise-
validateFields验证指定列(字段)数据, 不传入任何参数时,同validate方法(filedList?: FieldPath[], rowindex?: number) => Promise-
clearValidate清除指定验证结果(filedList?: FieldPath[], rowindex?: number) => void-
scrollToField滚动到第一个错误位置() => void-
1.4.6-beat4

5 months ago

1.4.6-beat3

5 months ago

1.4.6-beat2

5 months ago

1.4.6-beat1

5 months ago

1.4.6

5 months ago

1.4.5-bate34

6 months ago

1.4.5-bate31

6 months ago

1.4.5-bate33

6 months ago

1.4.5-bate32

6 months ago

1.4.5-bate30

6 months ago

1.4.5-bate29

6 months ago

1.4.5-bate20

6 months ago

1.4.5-bate22

6 months ago

1.4.5-bate21

6 months ago

1.4.5-bate24

6 months ago

1.4.5-bate23

6 months ago

1.4.5-bate26

6 months ago

1.4.5-bate25

6 months ago

1.4.5-bate28

6 months ago

1.4.5-bate27

6 months ago

1.4.5-bate19

6 months ago

1.4.5-bate17

6 months ago

1.4.5-bate18

6 months ago

1.4.5-bate13

7 months ago

1.4.5-bate12

7 months ago

1.4.5-bate15

7 months ago

1.4.5-bate14

7 months ago

1.4.5-bate16

7 months ago

1.4.5-bate11

7 months ago

1.4.5-bate10

7 months ago

1.4.5-bate2

8 months ago

1.4.5-bate1

8 months ago

1.4.5-bate6

7 months ago

1.4.5-bate5

7 months ago

1.4.5-bate4

7 months ago

1.4.5-bate3

8 months ago

1.4.5-bate9

7 months ago

1.4.5-bate8

7 months ago

1.4.5-bate7

7 months ago

1.4.4

8 months ago

1.4.4-bate27

8 months ago

1.4.4-bate20

8 months ago

1.4.4-bate21

8 months ago

1.4.4-bate14

9 months ago

1.4.4-bate17

9 months ago

1.4.4-bate18

8 months ago

1.4.4-bate15

9 months ago

1.4.4-bate16

9 months ago

1.4.4-bate19

8 months ago

1.4.4-bate24

8 months ago

1.4.4-bate25

8 months ago

1.4.4-bate22

8 months ago

1.4.4-bate23

8 months ago

1.4.4-bate26

8 months ago

1.4.4-bate13

9 months ago

1.4.4-bate11

9 months ago

1.4.4-bate12

9 months ago

1.4.4-bate10

9 months ago

1.4.4-bate9

9 months ago

1.4.4-bate8

9 months ago

1.4.4-bate3

9 months ago

1.4.4-bate5

9 months ago

1.4.4-bate4

9 months ago

1.4.4-bate7

9 months ago

1.4.4-bate6

9 months ago

1.4.4-bate2

9 months ago

1.4.3

9 months ago

1.4.4-bate1

9 months ago

1.4.3-bate13

9 months ago

1.4.3-bate12

9 months ago

1.4.3-bate11

9 months ago

1.4.3-bate14

9 months ago

1.4.3-bate10

9 months ago

1.4.3-bate7

9 months ago

1.4.3-bate8

9 months ago

1.4.3-bate4

9 months ago

1.4.3-bate5

9 months ago

1.4.3-bate6

9 months ago

1.4.3-bate1

9 months ago

1.4.3-bate2

9 months ago

1.4.3-bate3

9 months ago

1.4.2

9 months ago

1.4.2-bate6

9 months ago

1.4.0-bate1

11 months ago

1.3.9-bate9

11 months ago

1.3.9-bate8

11 months ago

1.3.9-bate7

11 months ago

1.3.9-bate6

11 months ago

1.3.9-bate5

11 months ago

1.3.9-bate4

11 months ago

1.3.9-bate3

11 months ago

1.3.9-bate2

11 months ago

1.3.9-bate1

11 months ago

1.4.1-bate7

11 months ago

1.4.1-bate8

11 months ago

1.4.1-bate9

10 months ago

1.4.1-bate3

11 months ago

1.4.1-bate4

11 months ago

1.4.1-bate5

11 months ago

1.4.1-bate6

11 months ago

1.4.1-bate2

11 months ago

1.4.1

11 months ago

1.4.0

11 months ago

1.3.8-bate50

11 months ago

1.3.8-bate49

11 months ago

1.3.8-bate48

11 months ago

1.3.8-bate47

11 months ago

1.3.8-bate46

11 months ago

1.3.9-bate13

11 months ago

1.3.9-bate11

11 months ago

1.3.9-bate12

11 months ago

1.3.9-bate10

11 months ago

1.4.2-bate4

9 months ago

1.4.2-bate5

9 months ago

1.4.2-bate2

10 months ago

1.4.2-bate3

10 months ago

1.3.9-bate15

11 months ago

1.3.9-bate16

11 months ago

1.4.2-bate1

10 months ago

1.3.8-bate44

11 months ago

1.3.8-bate43

11 months ago

1.3.8-bate42

11 months ago

1.3.8-bate41

11 months ago

1.3.8-bate40

11 months ago

1.3.8-bate39

11 months ago

1.3.8-bate38

11 months ago

1.3.8-bate37

11 months ago

1.3.8-bate36

11 months ago

1.3.8-bate35

11 months ago

1.3.8-bate34

11 months ago

1.3.8-bate33

11 months ago

1.3.8-bate32

11 months ago

1.3.8-bate31

11 months ago

1.3.8-bate30

11 months ago

1.3.8-bate29

12 months ago

1.3.8-bate28

12 months ago

1.3.8-bate27

12 months ago

1.3.8-bate26

12 months ago

1.3.8-bate25

12 months ago

1.3.8-bate23

12 months ago

1.3.8-bate22

12 months ago

1.3.8-bate21

12 months ago

1.3.8-bate20

12 months ago

1.3.8-bate19

12 months ago

1.3.8-bate17

12 months ago

1.3.8-bate13

12 months ago

1.3.8-bate12

12 months ago

1.3.8-bate9

12 months ago

1.3.8-bate11

12 months ago

1.3.8-bate10

12 months ago

1.3.8-bate6

12 months ago

1.3.8-bate5

12 months ago

1.3.8-bate8

12 months ago

1.3.8-bate7

12 months ago

1.3.8-bate16

12 months ago

1.3.8-bate15

12 months ago

1.3.8-bate14

12 months ago

1.3.8-bate2

12 months ago

1.3.8-bate1

12 months ago

1.3.8-bate4

12 months ago

1.3.8-bate3

12 months ago

1.3.7

12 months ago

1.3.6

12 months ago

1.3.5

1 year ago

1.3.4

1 year ago

1.3.3

1 year ago

1.3.2

1 year ago

1.3.2-beta28

1 year ago

1.3.2-beta27

1 year ago

1.3.2-beta26

1 year ago

1.3.2-beta25

1 year ago

1.3.2-beta24

1 year ago

1.3.2-beta22

1 year ago

1.3.2-beta21

1 year ago

1.3.2-beta20

1 year ago

1.3.2-beta19

1 year ago

1.3.2-beta18

1 year ago

1.3.2-beta17

1 year ago

1.3.2-beta16

1 year ago

1.3.2-beta15

1 year ago

1.3.2-beta14

1 year ago

1.3.2-beta13

1 year ago

1.3.2-beta12

1 year ago

1.3.2-beta11

1 year ago

1.3.2-beta10

1 year ago

1.3.2-beta9

1 year ago

1.3.2-beta8

1 year ago

1.3.2-beta7

1 year ago

1.3.2-beta6

1 year ago

1.3.2-beta5

1 year ago

1.3.2-beta4

1 year ago

1.3.2-beta3

1 year ago

1.3.2-beta2

1 year ago

1.3.2-beta1

1 year ago

1.3.1-beta2

1 year ago

1.3.1-beta1

1 year ago

1.3.0

1 year ago

1.2.9

1 year ago

1.2.8

1 year ago

1.2.7

1 year ago

1.2.6

1 year ago

1.2.5

1 year ago

1.2.4

1 year ago

1.2.3

1 year ago

1.2.2

1 year ago

1.2.1

1 year ago

1.2.0

1 year ago

1.0.11

1 year ago

1.1.0

1 year ago

1.0.9

1 year ago

1.0.8

1 year ago

1.0.7

1 year ago

1.0.6

1 year ago

1.0.5

1 year ago

1.0.4

1 year ago

1.0.3

1 year ago

1.0.2

1 year ago

1.0.1

1 year ago

1.0.0

1 year ago