-
Notifications
You must be signed in to change notification settings - Fork 140
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(pro:transfer): add layoutTool support to table transfer (#1579)
- Loading branch information
Showing
7 changed files
with
143 additions
and
26 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
--- | ||
order: 111 | ||
title: | ||
zh: 表格穿梭框布局工具 | ||
en: Table transfer layoutTool | ||
--- | ||
|
||
## zh | ||
|
||
通过 `tableProps.sourceLayoutTool` 和 `tableProps.targetLayoutTool` 指定待选框和已选框的布局工具配置 | ||
|
||
## en | ||
|
||
Set layoutTool config via `tableProps.sourceLayoutTool` and `tableProps.targetLayoutTool`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,64 @@ | ||
<template> | ||
<IxProTransfer | ||
v-model:value="targetKeys" | ||
type="table" | ||
:scroll="{ width: { source: 500 } }" | ||
:data-source="dataSource" | ||
:table-props="tableProps" | ||
/> | ||
</template> | ||
|
||
<script setup lang="ts"> | ||
import type { TransferData } from '@idux/pro/transfer' | ||
import { ref } from 'vue' | ||
import { TableColumn } from '@idux/components/table' | ||
interface Data extends TransferData { | ||
key: number | ||
disabled: boolean | ||
name: string | ||
age: number | ||
address: string | ||
} | ||
const sourceColumns: TableColumn<Data>[] = [ | ||
{ | ||
title: 'Name', | ||
dataKey: 'name', | ||
}, | ||
{ | ||
title: 'Age', | ||
dataKey: 'age', | ||
}, | ||
{ | ||
title: 'Address', | ||
dataKey: 'address', | ||
}, | ||
] | ||
const targetColumns: TableColumn<Data>[] = [ | ||
{ | ||
title: 'Name', | ||
dataKey: 'name', | ||
}, | ||
] | ||
const tableProps = { | ||
sourceColumns, | ||
targetColumns, | ||
sourceLayoutTool: true, | ||
targetLayoutTool: false, | ||
} | ||
const targetKeys = ref<number[]>(Array.from(new Array(10)).map((_, idx) => idx)) | ||
const dataSource: Data[] = Array.from(new Array(20)).map((_, idx) => ({ | ||
key: idx, | ||
disabled: [1, 6, 12, 16].includes(idx), | ||
name: 'Candidate' + idx, | ||
age: idx, | ||
address: 'London No.1 Lake Park', | ||
})) | ||
</script> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters