import {computed, ExtractPropTypes} from "@peryl/react-compose"; import {CascadePropsOptions} from "./cascade.utils"; import {PlainObject} from "@peryl/utils/event"; export function createCascadeUtils({ props }: { props: Readonly> }) { /*工具函数,获取对象的显示文本*/ const getLabel = computed(() => { const { labelField } = props; return typeof labelField === "string" ? ((val: PlainObject) => val[labelField]) : (val: PlainObject) => labelField(val); }); return { getLabel }; } export type tCascadeUtils = ReturnType