feat(form): 表格拖动支持tdesign

This commit is contained in:
roymondchen 2025-11-19 14:39:49 +08:00
parent 97affb2bff
commit e2708b868b
2 changed files with 2 additions and 2 deletions

View File

@ -20,7 +20,7 @@ export const useSortable = (
const rowDrop = () => { const rowDrop = () => {
sortable?.destroy(); sortable?.destroy();
const tableEl = tMagicTableRef.value?.getEl(); const tableEl = tMagicTableRef.value?.getEl();
const tBodyEl = tableEl?.querySelector('.el-table__body > tbody'); const tBodyEl = tableEl?.querySelector('.el-table__body > tbody') || tableEl?.querySelector('.t-table__body');
if (!tBodyEl) { if (!tBodyEl) {
return; return;
} }

View File

@ -341,7 +341,7 @@ export const sortArray = (data: any[], newIndex: number, oldIndex: number, sortK
} }
} }
return newData; return cloneDeep(newData);
}; };
export const sortChange = (data: any[], { prop, order }: SortProp) => { export const sortChange = (data: any[], { prop, order }: SortProp) => {