fix: add middleComponent prop in KeyValueInput component
1. add middleComponent prop in KeyValueInput component to support show default equal sign or others Change-Id: I29bdfb3df6c859b2522b2a10a21173defce7765e
This commit is contained in:
@@ -26,6 +26,7 @@ export default class index extends Component {
|
||||
valueReadonly: PropTypes.bool,
|
||||
keySpan: PropTypes.number,
|
||||
valueSpan: PropTypes.number,
|
||||
middleComponent: PropTypes.node,
|
||||
};
|
||||
|
||||
static defaultProps = {
|
||||
@@ -36,6 +37,7 @@ export default class index extends Component {
|
||||
},
|
||||
keyReadonly: false,
|
||||
valueReadonly: false,
|
||||
middleComponent: <PauseOutlined rotate={90} />,
|
||||
};
|
||||
|
||||
constructor(props) {
|
||||
@@ -87,7 +89,10 @@ export default class index extends Component {
|
||||
valueSpan,
|
||||
keyPlaceholder = t('Please input key'),
|
||||
valuePlaceholder = t('Please input value'),
|
||||
middleComponent,
|
||||
} = this.props;
|
||||
const style = { textAlign: 'center', lineHeight: '30px', margin: '0 10px' };
|
||||
const component = <div style={style}>{middleComponent}</div>;
|
||||
return (
|
||||
<Row>
|
||||
<Col span={keySpan || 4}>
|
||||
@@ -99,9 +104,7 @@ export default class index extends Component {
|
||||
required
|
||||
/>
|
||||
</Col>
|
||||
<Col span={1} style={{ textAlign: 'center', lineHeight: '30px' }}>
|
||||
<PauseOutlined rotate={90} />
|
||||
</Col>
|
||||
{component}
|
||||
<Col span={valueSpan || 8}>
|
||||
<Input
|
||||
value={value}
|
||||
|
Reference in New Issue
Block a user