select 支持选项级别 disabled 配置
This commit is contained in:
parent
7670faceea
commit
31c6ec6e87
|
@ -100,6 +100,14 @@
|
|||
&:hover {
|
||||
background-color: darken($Form-selectValue-bg, 5%);
|
||||
}
|
||||
|
||||
&.is-disabled {
|
||||
pointer-events: none;
|
||||
display: none;
|
||||
cursor: not-allowed;
|
||||
background-color: lighten($Form-selectValue-bg, 5%);
|
||||
background: lighten($Form-selectValue-bg, 5%);
|
||||
}
|
||||
}
|
||||
|
||||
&-arrow {
|
||||
|
|
|
@ -542,7 +542,9 @@ export class Select extends React.Component<SelectProps, SelectState> {
|
|||
multiple ? (
|
||||
<div className={`${ns}Select-value`} key={index}>
|
||||
<span
|
||||
className={`${ns}Select-valueIcon ${disabled ? 'is-disabled' : ''}`}
|
||||
className={`${ns}Select-valueIcon ${
|
||||
disabled || item.disabled ? 'is-disabled' : ''
|
||||
}`}
|
||||
onClick={this.removeItem.bind(this, index)}
|
||||
>
|
||||
×
|
||||
|
@ -694,6 +696,7 @@ export class Select extends React.Component<SelectProps, SelectState> {
|
|||
onChange={() => {
|
||||
this.handleChange(item);
|
||||
}}
|
||||
disabled={item.disabled}
|
||||
>
|
||||
{item.disabled
|
||||
? item[labelField]
|
||||
|
|
Loading…
Reference in New Issue