component.ts 356 B

123456789101112131415
  1. import { parse } from "@/cool";
  2. import type { ClCascaderOption, ClListViewItem } from "../types";
  3. export function useListView(data: UTSJSONObject[]) {
  4. return data.map((e) => {
  5. return parse<ClListViewItem>({
  6. ...e,
  7. value: e
  8. })!;
  9. });
  10. }
  11. export function useCascader(data: UTSJSONObject[]) {
  12. return data.map((e) => parse<ClCascaderOption>(e)!);
  13. }