添加 cl-tree 树形组件

This commit is contained in:
icssoa
2025-09-01 01:23:29 +08:00
parent e356244639
commit 73a472053f
12 changed files with 1137 additions and 3 deletions

View File

@@ -1,5 +1,5 @@
import { parse } from "@/cool";
import type { ClCascaderOption, ClListViewItem } from "../types";
import type { ClCascaderOption, ClListViewItem, ClTreeItem } from "../types";
export function useListView(data: UTSJSONObject[]) {
return data.map((e) => {
@@ -13,3 +13,12 @@ export function useListView(data: UTSJSONObject[]) {
export function useCascader(data: UTSJSONObject[]) {
return data.map((e) => parse<ClCascaderOption>(e)!);
}
export function useTree(data: UTSJSONObject[]) {
return data.map((e) => {
return parse<ClTreeItem>({
...e,
value: e
})!;
});
}