@@ -620,6 +620,7 @@ window.ComponentCascadeDot = class {
620
620
} else {
621
621
this . DOM = document . querySelector ( selector ) ;
622
622
}
623
+ this . _triggerEvent = { func :null , enable :false } ;
623
624
this . limit = 0 ;
624
625
this . select = select ;
625
626
this . selected_data = [ ] ;
@@ -718,7 +719,9 @@ window.ComponentCascadeDot = class {
718
719
} ) ;
719
720
if ( data . checked === false ) {
720
721
if ( this . limit > 0 && this . select_data . length >= this . limit && ( this . SELECTED_DOM . firstChild instanceof HTMLElement ) ) {
722
+ this . _triggerEvent . enable = false ;
721
723
this . SELECTED_DOM . firstChild . click ( ) ;
724
+ this . _triggerEvent . enable = true ;
722
725
}
723
726
data . checked = true ;
724
727
this . _tagCal ( data . key , this . MODE . insert ) ;
@@ -856,7 +859,7 @@ window.ComponentCascadeDot = class {
856
859
if ( this . insertInputDOM instanceof HTMLElement ) this . insertInputDOM . value = JSON . stringify ( this . insert_data ) ;
857
860
}
858
861
}
859
- if ( typeof this . _triggerEvent == 'function' ) this . _triggerEvent ( this . select_data , this . insert_data , this . delete_data ) ;
862
+ if ( typeof this . _triggerEvent . func == 'function' && this . _triggerEvent . enable === true ) this . _triggerEvent . func ( this . select_data , this . insert_data , this . delete_data ) ;
860
863
} ;
861
864
862
865
this . _search = function ( search ) {
@@ -945,7 +948,9 @@ window.ComponentCascadeDot = class {
945
948
this . _bind = function ( ) {
946
949
setTimeout ( ( ) => {
947
950
this . selected_label_dom . forEach ( ( D ) => {
951
+ this . _triggerEvent . enable = false ;
948
952
D . click ( ) ;
953
+ this . _triggerEvent . enable = true ;
949
954
} ) ;
950
955
} ) ;
951
956
if ( this . selectInputDOM instanceof HTMLElement ) this . selectInputDOM . value = JSON . stringify ( this . select_data ) ;
@@ -967,7 +972,7 @@ window.ComponentCascadeDot = class {
967
972
968
973
trigger ( f = function ( ) {
969
974
} ) {
970
- this . _triggerEvent = f ;
975
+ this . _triggerEvent = { func : f , enable : true } ;
971
976
return this ;
972
977
}
973
978
0 commit comments