From 8d53af03d1259a7873d83fdc2fea92a778646dac Mon Sep 17 00:00:00 2001 From: 2betop <2betop.cn@gmail.com> Date: Thu, 28 May 2020 14:43:53 +0800 Subject: [PATCH 1/2] =?UTF-8?q?=E6=94=AF=E6=8C=81=E9=BB=98=E8=AE=A4?= =?UTF-8?q?=E5=B1=95=E5=BC=80=E6=A8=A1=E5=BC=8F?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/components/TreeCheckboxes.tsx | 81 +++++++++++++++++++++++++------ 1 file changed, 67 insertions(+), 14 deletions(-) diff --git a/src/components/TreeCheckboxes.tsx b/src/components/TreeCheckboxes.tsx index 621f1e76..8d4a56fb 100644 --- a/src/components/TreeCheckboxes.tsx +++ b/src/components/TreeCheckboxes.tsx @@ -4,12 +4,14 @@ import React from 'react'; import uncontrollable from 'uncontrollable'; import Checkbox from './Checkbox'; import {Option} from './Select'; -import {autobind} from '../utils/helper'; +import {autobind, eachTree} from '../utils/helper'; -export interface TreeCheckboxesProps extends CheckboxesProps {} +export interface TreeCheckboxesProps extends CheckboxesProps { + expand?: 'all' | 'first' | 'root' | 'none'; +} export interface TreeCheckboxesState { - collapsed: Array