File tree Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Expand file tree Collapse file tree 2 files changed +11
-6
lines changed Original file line number Diff line number Diff line change @@ -166,10 +166,12 @@ export default class Tags extends Component {
166
166
multiple
167
167
defaultValue = { [ 1 , 4 ] }
168
168
data = { [
169
- { text : 'Development' ,
169
+ { text : 'Development' ,
170
170
children : [
171
- { text : 'bug' , id : 1 } ,
172
- { text : 'feature' , id : 2 } ] } ,
171
+ { text : 'bug' , id : 1 } ,
172
+ { text : 'feature' , id : 2 } ,
173
+ ] ,
174
+ } ,
173
175
{ text : 'documents' , id : 3 } ,
174
176
{ text : 'discussion' , id : 4 } ,
175
177
] }
Original file line number Diff line number Diff line change @@ -112,6 +112,7 @@ export default class Select2 extends Component {
112
112
const type = typeof value ;
113
113
return type === 'function' || ( value && type === 'object' ) || false ;
114
114
}
115
+
115
116
makeOption ( item , k ) {
116
117
if ( this . isObject ( item ) ) {
117
118
const { id, text, ...itemParams } = item ;
@@ -129,9 +130,11 @@ export default class Select2 extends Component {
129
130
{ data . map ( ( item , k ) => {
130
131
if ( this . isObject ( item ) && this . isObject ( item . children ) ) {
131
132
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
+ ) ;
135
138
}
136
139
return this . makeOption ( item , k ) ;
137
140
} ) }
You can’t perform that action at this time.
0 commit comments