fix: Transfer组件reload不生效问题 (#4465)

This commit is contained in:
RUNZE LU 2022-05-27 18:32:21 +08:00 committed by GitHub
parent a080ee72cf
commit aeafae35f4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 16 additions and 27 deletions

View File

@ -71,39 +71,22 @@ export default {
}
}
},
{
type: 'action',
actionType: 'reload',
label: '刷新 reload',
level: 'primary',
className: 'mr-3 mb-3',
target: 'transfer'
},
{
label: '穿梭器',
id: 'transfer-receiver',
type: 'transfer',
name: 'transfer',
debugger: true,
resetValue: 'zhugeliang',
options: [
{
label: '诸葛亮',
value: 'zhugeliang'
},
{
label: '曹操',
value: 'caocao'
},
{
label: '钟无艳',
value: 'zhongwuyan'
},
{
label: '李白',
value: 'libai'
},
{
label: '韩信',
value: 'hanxin'
},
{
label: '云中君',
value: 'yunzhongjun'
}
]
resetValue: 'c',
source: '/api/mock2/form/getTreeOptions'
}
]
},

View File

@ -150,6 +150,12 @@ export class BaseTransferRenderer<
> extends React.Component<T> {
tranferRef?: BaseTransfer;
reload() {
const {reloadOptions} = this.props;
reloadOptions?.();
}
@autobind
async handleChange(value: Array<Option> | Option, optionModified?: boolean) {
const {