File tree Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Expand file tree Collapse file tree 2 files changed +8
-4
lines changed Original file line number Diff line number Diff line change @@ -97,6 +97,7 @@ export default {
9797 if (halfcheck) {
9898 this .$set (child, " halfcheck" , false );
9999 }
100+ this .$set (child, " parentCheckedToChildren" , true );
100101 }
101102 if (this .allowCheckedChildrenOfDisabledChild ) {
102103 this .childCheckedHandle (child, checked, halfcheck);
@@ -105,9 +106,9 @@ export default {
105106 }
106107 },
107108 parentCheckedHandle (parentNode , checked , halfcheck = false ) {
108- if (! parentNode || parentNode .chkDisabled ) return false ;
109+ if (! parentNode || parentNode .chkDisabled || !! parentNode . checked === checked ) return false ;
109110 let [someBortherNodeChecked, allBortherNodeChecked] = [checked, checked];
110- const childNodes = parentNode .children ;
111+ const childNodes = parentNode .children
111112 if (checked) {
112113 allBortherNodeChecked = childNodes .every (
113114 child => child .checked && ! child .halfcheck
Original file line number Diff line number Diff line change @@ -239,10 +239,13 @@ export default {
239239 this .parentChecked (parentNode, checked, halfcheck);
240240 },
241241 checkedChange () {
242- const { checked = false } = this .item ;
243- if (! this .scoped ) {
242+ const { checked = false , parentCheckedToChildren = false } = this .item ;
243+ if (! this .scoped || ! parentCheckedToChildren ) {
244244 this .theParentChecked (checked, this .halfcheck );
245245 }
246+ if (parentCheckedToChildren) {
247+ this .$delete (this .item , ' parentCheckedToChildren' )
248+ }
246249 }
247250 }
248251};
You can’t perform that action at this time.
0 commit comments