Browse Source

Fix eslint errors

pull/18209/head
afc163 5 years ago
parent
commit
d07b298ae4
  1. 1
      .eslintrc.js
  2. 11
      components/form/demo/customized-form-controls.md

1
.eslintrc.js

@ -104,6 +104,7 @@ if (process.env.RUN_ENV === 'DEMO') {
'react/no-multi-comp': 0,
'jsx-a11y/href-no-hash': 0,
'import/no-extraneous-dependencies': 0,
'jsx-a11y/control-has-associated-label': 0,
});
}

11
components/form/demo/customized-form-controls.md

@ -73,24 +73,27 @@ class PriceInput extends React.Component {
// Should provide an event to pass value to Form.
const { onChange } = this.props;
if (onChange) {
onChange(Object.assign({}, this.state, changedValue));
onChange({
...this.state,
...changedValue,
});
}
};
render() {
const { size } = this.props;
const { state } = this;
const { currency, number } = this.state;
return (
<span>
<Input
type="text"
size={size}
value={state.number}
value={number}
onChange={this.handleNumberChange}
style={{ width: '65%', marginRight: '3%' }}
/>
<Select
value={state.currency}
value={currency}
size={size}
style={{ width: '32%' }}
onChange={this.handleCurrencyChange}

Loading…
Cancel
Save