diff --git a/.changeset/real-masks-glow.md b/.changeset/real-masks-glow.md new file mode 100644 index 000000000..59c052718 --- /dev/null +++ b/.changeset/real-masks-glow.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/check-tree-select": minor +--- + +feat: add size api diff --git a/.changeset/wise-teachers-tease.md b/.changeset/wise-teachers-tease.md new file mode 100644 index 000000000..ba7f06c59 --- /dev/null +++ b/.changeset/wise-teachers-tease.md @@ -0,0 +1,5 @@ +--- +"@hi-ui/hiui": patch +--- + +CheckTreeSelect feat: add size api diff --git a/packages/ui/check-tree-select/src/CheckTreeSelect.tsx b/packages/ui/check-tree-select/src/CheckTreeSelect.tsx index d9ea5fb66..309fca09b 100644 --- a/packages/ui/check-tree-select/src/CheckTreeSelect.tsx +++ b/packages/ui/check-tree-select/src/CheckTreeSelect.tsx @@ -17,7 +17,7 @@ import { uniqBy } from '@hi-ui/array-utils' import { Highlighter } from '@hi-ui/highlighter' import { TagInputMock, TagInputMockProps } from '@hi-ui/tag-input' import { UpOutlined, DownOutlined } from '@hi-ui/icons' -import { useLocaleContext } from '@hi-ui/core' +import { HiBaseSizeEnum, useLocaleContext } from '@hi-ui/core' import { callAllFuncs } from '@hi-ui/func-utils' import Checkbox from '@hi-ui/checkbox' // import { UseDataSource } from '@hi-ui/use-data-source' @@ -89,6 +89,7 @@ export const CheckTreeSelect = forwardRef { + const [data] = React.useState([ + { + title: '手机类', + id: '0', + children: [ + { + title: 'Redmi系列', + id: '0-0', + disabled: true, + children: [ + { + id: '0-0-1', + title: 'Redmi K30', + }, + { + id: '0-0-2', + title: 'Redmi K30 Pro', + }, + { + id: '0-0-3', + title: 'Redmi 10X 5G', + }, + { + id: '0-0-4', + title: 'Redmi Note 8', + }, + { + id: '0-0-5', + title: 'Redmi 9', + }, + { + id: '0-0-6', + title: 'Redmi 9A', + }, + ], + }, + { + title: '小米手机', + id: '0-1', + children: [ + { + id: '0-1-1', + title: '小米10 Pro', + }, + { + id: '0-1-2', + title: '小米10', + }, + { + id: '0-1-3', + title: '小米10 青春版 5G', + }, + { + id: '0-1-4', + title: '小米MIX Alpha', + }, + ], + }, + ], + }, + { + title: '电视', + id: '1', + children: [ + { + title: '小米电视 大师 65英寸OLED', + id: '1-0', + }, + { + title: 'Redmi 智能电视 MAX 98', + id: '1-1', + }, + { + title: '小米电视4A 60英寸', + id: '1-2', + }, + ], + }, + ]) + + return ( + <> +

Size

+
+

sm

+ +

md

+ +

lg

+ +
+ + ) +}