tanxin-ui 0.8.3 → 0.8.4

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -19108,6 +19108,7 @@ const treeProps = {
19108
19108
  expandOnClick: PropTypes.bool.def(true),
19109
19109
  checkOnClick: PropTypes.bool.def(false),
19110
19110
  checkRelated: PropTypes.bool.def(true),
19111
+ checkRelatedOnlySon: PropTypes.bool.def(false),
19111
19112
  single: PropTypes.bool.def(false),
19112
19113
  onlyLeaf: PropTypes.bool.def(false),
19113
19114
  loadMethod: {
@@ -19307,9 +19308,11 @@ var Tree = defineComponent({
19307
19308
  const checkedChange = (item, checked) => {
19308
19309
  if (props.checkRelated && !props.single) {
19309
19310
  setSonChecked(item, checked);
19310
- const fatherKeyPath = cloneDeep(item.keyPath);
19311
- fatherKeyPath.pop();
19312
- setFatherChecked(nodeList.value, fatherKeyPath);
19311
+ if (props.checkRelatedOnlySon) {
19312
+ const fatherKeyPath = cloneDeep(item.keyPath);
19313
+ fatherKeyPath.pop();
19314
+ setFatherChecked(nodeList.value, fatherKeyPath);
19315
+ }
19313
19316
  }
19314
19317
  if (props.single) {
19315
19318
  checkedValues.value = [singleValue.value];
@@ -19318,7 +19321,7 @@ var Tree = defineComponent({
19318
19321
  emit("nodeChecked", item, checkedValues.value);
19319
19322
  };
19320
19323
  const setFatherChecked = (nodeList2, fatherKeyPath) => {
19321
- if (!props.checkRelated || props.single)
19324
+ if (!props.checkRelated || props.single || props.checkRelatedOnlySon)
19322
19325
  return;
19323
19326
  const index2 = nodeList2.findIndex((son) => fatherKeyPath.includes(son[props.valueKey]));
19324
19327
  if (index2 >= 0) {