Skip to content

Commit

Permalink
Merge pull request #6 from yusangeng/master
Browse files Browse the repository at this point in the history
Correct lint errors.
  • Loading branch information
yusangeng committed Nov 27, 2018
2 parents 090d8de + 5a08b19 commit 7e09943
Show file tree
Hide file tree
Showing 3 changed files with 21 additions and 7 deletions.
19 changes: 15 additions & 4 deletions demo/SwitchFormFieldDemo.js
Expand Up @@ -18,16 +18,27 @@ class Demo extends React.Component {
};
}

handleChange (data) {
console.log('change', data)
handleChange(data) {
console.log('change', data);
}

render() {
return (
<div>
<Form jsxonChange={this.handleChange.bind(this)}>
<SwitchFormField jsxname="switch" jsxlabel="Switch模式" checkedChildren="是" unCheckedChildren="否" />
<SwitchFormField jsxname="radio" useRadioGroup jsxlabel="Radio模式" checkedChildren="是" unCheckedChildren="否" />
<SwitchFormField
jsxname="switch"
jsxlabel="Switch模式"
checkedChildren="是"
unCheckedChildren="否"
/>
<SwitchFormField
jsxname="radio"
useRadioGroup
jsxlabel="Radio模式"
checkedChildren="是"
unCheckedChildren="否"
/>
</Form>
</div>
);
Expand Down
5 changes: 3 additions & 2 deletions src/SwitchFormField.jsx
Expand Up @@ -85,7 +85,8 @@ class SwitchFormField extends FormField {
value={value ? RadioValues.On : RadioValues.Off}
onChange={this.handleChange.bind(this)}
style={{}}
className="">
className=""
>
<Item value={RadioValues.On} text={checkedChildren} />
<Item value={RadioValues.Off} text={unCheckedChildren} />
</RadioGroup>
Expand Down Expand Up @@ -116,7 +117,7 @@ class SwitchFormField extends FormField {
const { checkedChildren, unCheckedChildren, useRadioGroup } = props;

if (mode === Constants.MODE.EDIT) {
return useRadioGroup ? this.renderRadioGroup() : this.renderSwitch()
return useRadioGroup ? this.renderRadioGroup() : this.renderSwitch();
}

return (
Expand Down
4 changes: 3 additions & 1 deletion src/index.js
Expand Up @@ -6,4 +6,6 @@
* All rights reserved.
*/

export default from './SwitchFormField';
import SwitchFormField from './SwitchFormField';

export default SwitchFormField;

0 comments on commit 7e09943

Please sign in to comment.