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"
|
:rowClassName="getRowClassName"
|
||||||
v-show="getEmptyDataIsShowTable"
|
v-show="getEmptyDataIsShowTable"
|
||||||
@change="handleTableChange"
|
@change="handleTableChange"
|
||||||
|
@resizeColumn="setColumnWidth"
|
||||||
>
|
>
|
||||||
<template #[item]="data" v-for="item in Object.keys($slots)" :key="item">
|
<template #[item]="data" v-for="item in Object.keys($slots)" :key="item">
|
||||||
<slot :name="item" v-bind="data || {}"></slot>
|
<slot :name="item" v-bind="data || {}"></slot>
|
||||||
@ -189,6 +190,7 @@
|
|||||||
getColumns,
|
getColumns,
|
||||||
setCacheColumnsByField,
|
setCacheColumnsByField,
|
||||||
setCacheColumns,
|
setCacheColumns,
|
||||||
|
setColumnWidth,
|
||||||
setColumns,
|
setColumns,
|
||||||
getColumnsRef,
|
getColumnsRef,
|
||||||
getCacheColumns,
|
getCacheColumns,
|
||||||
@ -345,6 +347,7 @@
|
|||||||
handleSearchInfoChange,
|
handleSearchInfoChange,
|
||||||
getEmptyDataIsShowTable,
|
getEmptyDataIsShowTable,
|
||||||
handleTableChange,
|
handleTableChange,
|
||||||
|
setColumnWidth,
|
||||||
getRowClassName,
|
getRowClassName,
|
||||||
wrapRef,
|
wrapRef,
|
||||||
tableAction,
|
tableAction,
|
||||||
|
@ -264,12 +264,19 @@ export function useColumns(
|
|||||||
if (!isArray(columns)) return;
|
if (!isArray(columns)) return;
|
||||||
cacheColumns = columns.filter((item) => !item.flag);
|
cacheColumns = columns.filter((item) => !item.flag);
|
||||||
}
|
}
|
||||||
|
/**
|
||||||
|
* 拖拽列宽修改列的宽度
|
||||||
|
*/
|
||||||
|
function setColumnWidth(w: number, col: BasicColumn) {
|
||||||
|
col.width = w;
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
getColumnsRef,
|
getColumnsRef,
|
||||||
getCacheColumns,
|
getCacheColumns,
|
||||||
getColumns,
|
getColumns,
|
||||||
setColumns,
|
setColumns,
|
||||||
|
setColumnWidth,
|
||||||
getViewColumns,
|
getViewColumns,
|
||||||
setCacheColumnsByField,
|
setCacheColumnsByField,
|
||||||
setCacheColumns,
|
setCacheColumns,
|
||||||
|
Loading…
Reference in New Issue
Block a user