小程序初始提交
This commit is contained in:
24
cool-unix/uni_modules/cool-ui/hooks/component.ts
Normal file
24
cool-unix/uni_modules/cool-ui/hooks/component.ts
Normal file
@@ -0,0 +1,24 @@
|
||||
import { parse } from "@/cool";
|
||||
import type { ClCascaderOption, ClListViewItem, ClTreeItem } from "../types";
|
||||
|
||||
export function useListView(data: UTSJSONObject[]) {
|
||||
return data.map((e) => {
|
||||
return parse<ClListViewItem>({
|
||||
...e,
|
||||
value: e
|
||||
})!;
|
||||
});
|
||||
}
|
||||
|
||||
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
|
||||
})!;
|
||||
});
|
||||
}
|
||||
Reference in New Issue
Block a user