Skip to content

Commit

Permalink
param to except indeterminate node in getCheckedNodes method
Browse files Browse the repository at this point in the history
  • Loading branch information
coolzjy committed Aug 2, 2016
1 parent 90f34ff commit b060e79
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/data/tree.vue
Original file line number Diff line number Diff line change
Expand Up @@ -33,17 +33,18 @@
},
methods: {
getCheckedNodes(leafNodeOnly) {
getCheckedNodes(leafNodeOnly, exceptIndeterminate) {
var checkedNodes = [];
var acceptable = exceptIndeterminate ? [true] : [true, 'half'];
var walk = function(node) {
var children = node.$children;
children.forEach(function(child) {
if (leafNodeOnly) {
if (child.isChecked && !child.hasChild) {
if (~acceptable.indexOf(child.isChecked) && !child.hasChild) {
checkedNodes.push(child.data);
}
} else {
if (child.isChecked) {
if (~acceptable.indexOf(child.isChecked)) {
checkedNodes.push(child.data);
}
}
Expand Down

0 comments on commit b060e79

Please sign in to comment.