Skip to content

Commit

Permalink
feat(transfer): add icon slot
Browse files Browse the repository at this point in the history
  • Loading branch information
oljc committed Sep 15, 2023
1 parent d614142 commit f6823d6
Show file tree
Hide file tree
Showing 3 changed files with 16 additions and 2 deletions.
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

0 comments on commit f6823d6

Please sign in to comment.