feat(table): 表格拖拽列改变宽度

* feat(funcation): update 修复表格无法拖拽列改变宽度

* feat(function): add 完善可伸缩列

---------

Co-authored-by: gavin-james <meaganlindesy1258@gmail.com>
This commit is contained in:
林飞 2023-09-22 10:35:30 +08:00 committed by GitHub
parent 5665fd62a9
commit 1cf2a81f2a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 10 additions and 0 deletions

View File

@ -21,6 +21,7 @@
:rowClassName="getRowClassName"
v-show="getEmptyDataIsShowTable"
@change="handleTableChange"
@resizeColumn="setColumnWidth"
>
<template #[item]="data" v-for="item in Object.keys($slots)" :key="item">
<slot :name="item" v-bind="data || {}"></slot>
@ -189,6 +190,7 @@
getColumns,
setCacheColumnsByField,
setCacheColumns,
setColumnWidth,
setColumns,
getColumnsRef,
getCacheColumns,
@ -345,6 +347,7 @@
handleSearchInfoChange,
getEmptyDataIsShowTable,
handleTableChange,
setColumnWidth,
getRowClassName,
wrapRef,
tableAction,

View File

@ -264,12 +264,19 @@ export function useColumns(
if (!isArray(columns)) return;
cacheColumns = columns.filter((item) => !item.flag);
}
/**
*
*/
function setColumnWidth(w: number, col: BasicColumn) {
col.width = w;
}
return {
getColumnsRef,
getCacheColumns,
getColumns,
setColumns,
setColumnWidth,
getViewColumns,
setCacheColumnsByField,
setCacheColumns,