mirror of
https://github.com/vbenjs/vue-vben-admin.git
synced 2025-01-24 10:33:50 +08:00
feat(table): 表格拖拽列改变宽度
* feat(funcation): update 修复表格无法拖拽列改变宽度 * feat(function): add 完善可伸缩列 --------- Co-authored-by: gavin-james <meaganlindesy1258@gmail.com>
This commit is contained in:
parent
5665fd62a9
commit
1cf2a81f2a
@ -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,
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user