Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat(transfer): add an action icon slot #2708

Merged
merged 1 commit into from
Sep 22, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions packages/web-vue/components/transfer/README.en-US.md
Original file line number Diff line number Diff line change
Expand Up @@ -56,6 +56,8 @@ description: A two-column multi-select component that moves elements from one co
|---|---|---|:---|
|source|Source content|data: `TransferItem[]`<br>selectedKeys: `string[]`<br>onSelect: `(value: string[]) => void`|2.39.0|
|source-title|Source Header|countTotal: `number`<br>countSelected: `number`<br>searchValue: `string`<br>checked: `boolean`<br>indeterminate: `boolean`<br>onSelectAllChange: `(checked:boolean) => void`<br>onClear: `() => void`|2.45.0|
|to-target-icon| To target icon slot|-||
|to-source-icon| To source icon slot|-||
|target|Target content|data: `TransferItem[]`<br>selectedKeys: `string[]`<br>onSelect: `(value: string[]) => void`|2.39.0|
|target-title|Target Header|countTotal: `number`<br>countSelected: `number`<br>searchValue: `string`<br>checked: `boolean`<br>indeterminate: `boolean`<br>onSelectAllChange: `(checked:boolean) => void`<br>onClear: `() => void`|2.45.0|
|item|Option|value: `string`<br>label: `string`||
Expand Down
2 changes: 2 additions & 0 deletions packages/web-vue/components/transfer/README.zh-CN.md
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,8 @@ description: 两栏布局的多选组件,将元素从一栏即时移到另一
|---|:---:|---|:---|
|source|源面板|data: `TransferItem[]`<br>selectedKeys: `string[]`<br>onSelect: `(value: string[]) => void`|2.39.0|
|source-title|源标题插槽|countTotal: `number`<br>countSelected: `number`<br>searchValue: `string`<br>checked: `boolean`<br>indeterminate: `boolean`<br>onSelectAllChange: `(checked:boolean) => void`<br>onClear: `() => void`|2.45.0|
|to-target-icon| 移至目标图标插槽|-||
|to-source-icon| 移至源图标插槽|-||
|target|目标面板|data: `TransferItem[]`<br>selectedKeys: `string[]`<br>onSelect: `(value: string[]) => void`|2.39.0|
|target-title|目标标题插槽|countTotal: `number`<br>countSelected: `number`<br>searchValue: `string`<br>checked: `boolean`<br>indeterminate: `boolean`<br>onSelectAllChange: `(checked:boolean) => void`<br>onClear: `() => void`|2.45.0|
|item|选项|value: `string`<br>label: `string`||
Expand Down
14 changes: 12 additions & 2 deletions packages/web-vue/components/transfer/transfer.vue
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
@click="handleClick('target')"
>
<template #icon>
<icon-right />
<slot name="to-target-icon"> <icon-right /> </slot>
</template>
</arco-button>
<arco-button
Expand All @@ -43,7 +43,7 @@
@click="handleClick('source')"
>
<template #icon>
<icon-left />
<slot name="to-source-icon"><icon-left /></slot>
</template>
</arco-button>
</div>
Expand Down Expand Up @@ -281,6 +281,16 @@ export default defineComponent({
* @binding {() => void} onClear
* @version 2.45.0
*/
/**
* @zh 移至源图标插槽
* @en To source icon slot
* @slot to-source-icon
*/
/**
* @zh 移至目标图标插槽
* @en To target icon slot
* @slot to-target-icon
*/
setup(props, { emit, slots }) {
const { mergedDisabled, eventHandlers } = useFormItem({
disabled: toRef(props, 'disabled'),
Expand Down
Loading