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, 'react/no-multi-comp': 0,
'jsx-a11y/href-no-hash': 0, 'jsx-a11y/href-no-hash': 0,
'import/no-extraneous-dependencies': 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. // Should provide an event to pass value to Form.
const { onChange } = this.props; const { onChange } = this.props;
if (onChange) { if (onChange) {
onChange(Object.assign({}, this.state, changedValue)); onChange({
...this.state,
...changedValue,
});
} }
}; };
render() { render() {
const { size } = this.props; const { size } = this.props;
const { state } = this; const { currency, number } = this.state;
return ( return (
<span> <span>
<Input <Input
type="text" type="text"
size={size} size={size}
value={state.number} value={number}
onChange={this.handleNumberChange} onChange={this.handleNumberChange}
style={{ width: '65%', marginRight: '3%' }} style={{ width: '65%', marginRight: '3%' }}
/> />
<Select <Select
value={state.currency} value={currency}
size={size} size={size}
style={{ width: '32%' }} style={{ width: '32%' }}
onChange={this.handleCurrencyChange} onChange={this.handleCurrencyChange}

Loading…
Cancel
Save