mirror of
https://gitee.com/baidu/amis.git
synced 2024-12-03 04:28:32 +08:00
值相同的选项优化
This commit is contained in:
parent
5c59cce7bd
commit
e81f56782a
@ -85,7 +85,10 @@ export class Transfer extends React.Component<TransferProps, TransferState> {
|
||||
const {options, option2value, onChange, value} = this.props;
|
||||
let valueArray = Checkboxes.value2array(value, options, option2value);
|
||||
const availableOptions = flattenTree(options).filter(
|
||||
option => !option.disabled && option.value !== void 0
|
||||
(option, index, list) =>
|
||||
!option.disabled &&
|
||||
option.value !== void 0 &&
|
||||
list.indexOf(option) === index
|
||||
);
|
||||
|
||||
if (valueArray.length < availableOptions.length) {
|
||||
@ -353,7 +356,10 @@ export class Transfer extends React.Component<TransferProps, TransferState> {
|
||||
|
||||
this.valueArray = Checkboxes.value2array(value, options, option2value);
|
||||
this.availableOptions = flattenTree(options).filter(
|
||||
option => !option.disabled && option.value !== void 0
|
||||
(option, index, list) =>
|
||||
!option.disabled &&
|
||||
option.value !== void 0 &&
|
||||
list.indexOf(option) === index
|
||||
);
|
||||
|
||||
return (
|
||||
|
Loading…
Reference in New Issue
Block a user