File tree Expand file tree Collapse file tree 4 files changed +4
-5
lines changed Expand file tree Collapse file tree 4 files changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -49,7 +49,7 @@ export default function useSelectOptions(
4949 dynamicIndex += 1 ;
5050 return res ;
5151 } ;
52- if ( ( option as SelectOptionGroup ) . group && ( option as SelectOptionGroup ) . children ) {
52+ if ( ( option as SelectOptionGroup ) . children ) {
5353 return {
5454 ...option ,
5555 children : ( option as SelectOptionGroup ) . children . map ( ( child ) => getFormatOption ( child ) ) ,
@@ -122,7 +122,7 @@ export default function useSelectOptions(
122122 const res : TdOptionProps [ ] = [ ] ;
123123 const getOptionsList = ( options : TdOptionProps [ ] ) => {
124124 options . forEach ( ( option ) => {
125- if ( ( option as SelectOptionGroup ) . group ) {
125+ if ( ( option as SelectOptionGroup ) . children ) {
126126 getOptionsList ( ( option as SelectOptionGroup ) . children ) ;
127127 } else {
128128 res . push ( option ) ;
Original file line number Diff line number Diff line change @@ -13,6 +13,5 @@ export default {
1313 /** 分组别名 */
1414 label : {
1515 type : String ,
16- default : '' ,
1716 } ,
1817} ;
Original file line number Diff line number Diff line change @@ -43,7 +43,7 @@ export default defineComponent({
4343 const children : ScopedSlotReturnValue = renderTNode ( 'default' ) ;
4444 return (
4545 < li class = { this . classes } >
46- < div class = { `${ this . componentName } -option-group__header` } > { this . label } </ div >
46+ { ( this . label ?? false ) && < div class = { `${ this . componentName } -option-group__header` } > { this . label } </ div > }
4747 { children }
4848 </ li >
4949 ) ;
Original file line number Diff line number Diff line change @@ -270,7 +270,7 @@ export default defineComponent({
270270 } & OptionsType ,
271271 index ,
272272 ) => {
273- if ( item . group ) {
273+ if ( item . children ) {
274274 return (
275275 < TOptionGroup label = { item . group } divider = { item . divider } >
276276 { this . renderOptionsContent ( item . children ) }
You can’t perform that action at this time.
0 commit comments