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 @@ -50,7 +50,7 @@ export default function useSelectOptions(
5050 dynamicIndex += 1 ;
5151 return res ;
5252 } ;
53- if ( ( option as SelectOptionGroup ) . group && ( option as SelectOptionGroup ) . children ) {
53+ if ( ( option as SelectOptionGroup ) . children ) {
5454 return {
5555 ...option ,
5656 children : ( option as SelectOptionGroup ) . children . map ( ( child ) => getFormatOption ( child ) ) ,
@@ -124,7 +124,7 @@ export default function useSelectOptions(
124124 const res : TdOptionProps [ ] = [ ] ;
125125 const getOptionsList = ( options : TdOptionProps [ ] ) => {
126126 options . forEach ( ( option ) => {
127- if ( ( option as SelectOptionGroup ) . group ) {
127+ if ( ( option as SelectOptionGroup ) . children ) {
128128 getOptionsList ( ( option as SelectOptionGroup ) . children ) ;
129129 } else {
130130 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 @@ -44,7 +44,7 @@ export default defineComponent({
4444 const children : ScopedSlotReturnValue = renderTNode ( 'default' ) ;
4545 return (
4646 < li class = { this . classes } >
47- < div class = { `${ this . componentName } -option-group__header` } > { this . label } </ div >
47+ { ( this . label ?? false ) && < div class = { `${ this . componentName } -option-group__header` } > { this . label } </ div > }
4848 { children }
4949 </ li >
5050 ) ;
Original file line number Diff line number Diff line change @@ -269,7 +269,7 @@ export default defineComponent({
269269 } & OptionsType ,
270270 index ,
271271 ) => {
272- if ( item . group ) {
272+ if ( item . children ) {
273273 return (
274274 < t-option-group label = { item . group } divider = { item . divider } >
275275 { this . renderOptionsContent ( item . children ) }
You can’t perform that action at this time.
0 commit comments