Files

25 lines
508 B
TypeScript
Raw Permalink Normal View History

2025-07-21 16:47:04 +08:00
import { parse } from "@/cool";
2025-09-01 01:23:29 +08:00
import type { ClCascaderOption, ClListViewItem, ClTreeItem } from "../types";
2025-07-21 16:47:04 +08:00
export function useListView(data: UTSJSONObject[]) {
2025-08-08 09:36:31 +08:00
return data.map((e) => {
return parse<ClListViewItem>({
...e,
value: e
})!;
});
2025-07-21 16:47:04 +08:00
}
export function useCascader(data: UTSJSONObject[]) {
return data.map((e) => parse<ClCascaderOption>(e)!);
}
2025-09-01 01:23:29 +08:00
export function useTree(data: UTSJSONObject[]) {
return data.map((e) => {
return parse<ClTreeItem>({
...e,
value: e
})!;
});
}