Skip to content

Commit c48c610

Browse files
committed
Fix js style
1 parent e9f733c commit c48c610

File tree

2 files changed

+11
-6
lines changed

2 files changed

+11
-6
lines changed

examples/src/components/Tags.js

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -166,10 +166,12 @@ export default class Tags extends Component {
166166
multiple
167167
defaultValue={[1, 4]}
168168
data={[
169-
{ text: 'Development',
169+
{ text: 'Development',
170170
children: [
171-
{ text: 'bug', id: 1 },
172-
{ text: 'feature', id: 2 }]},
171+
{ text: 'bug', id: 1 },
172+
{ text: 'feature', id: 2 },
173+
],
174+
},
173175
{ text: 'documents', id: 3 },
174176
{ text: 'discussion', id: 4 },
175177
]}

src/components/Select2.js

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -112,6 +112,7 @@ export default class Select2 extends Component {
112112
const type = typeof value;
113113
return type === 'function' || (value && type === 'object') || false;
114114
}
115+
115116
makeOption(item, k) {
116117
if (this.isObject(item)) {
117118
const { id, text, ...itemParams } = item;
@@ -129,9 +130,11 @@ export default class Select2 extends Component {
129130
{data.map((item, k) => {
130131
if (this.isObject(item) && this.isObject(item.children)) {
131132
const { children, text, ...itemParams } = item;
132-
return (<optgroup key={`optgroup-${k}`} label={text} {...itemParams}>
133-
{children.map((child, k2) => this.makeOption(child, `${k}-${k2}`))}
134-
</optgroup>);
133+
return (
134+
<optgroup key={`optgroup-${k}`} label={text} {...itemParams}>
135+
{children.map((child, k2) => this.makeOption(child, `${k}-${k2}`))}
136+
</optgroup>
137+
);
135138
}
136139
return this.makeOption(item, k);
137140
})}

0 commit comments

Comments
 (0)