ant design of vue a-tree组件子节点不完全勾选获取父节点的值

  onBusinessSelectChange(selectedKeys, info) {
      // console.log('selectedKeys changed: ', selectedKeys);
      // console.log('info changed: ', info);
 
      // 已勾选子节点以及半勾选状态的父节点
      this.allSelectedNodes = selectedKeys.concat(info.halfCheckedKeys);
      this.businessSelectedRowKeys = selectedKeys;
    },

 

<a-tree
        showLine
        checkable
        v-model='businessSelectedRowKeys'
        @check="onBusinessSelectChange"
        :treeData='businessData'
        :checkedKeys="businessSelectedRowKeys"
        :autoExpandParent="true"
        >
        </a-tree>
data(){
  return{
      test: [],
      businessData: [],
      businessSelectedRowKeys: [],
      allSelectedNodes: [],
  }
}

 

posted @ 2021-06-27 20:08  夏冬青  阅读(2241)  评论(0编辑  收藏  举报