父组件调用函数式子组件,并向子组件传递函数参数。
1, 父组件
调用子组件时,传递参数:函数
import useApprovalFlow from "/@/hooks/useApprovalFlow";const {getApproveBackSteps,waitForApprove,IsSaleManager,flowStatus,curFlowId,stepCanEscalation,waitApproveStepInfo,operAuth,execPointerId,approveStepName,workflowGuid,lastestSteps,allSteps,backSteps
} = useApprovalFlow(props.fn.resolveFunc,props.fn.getFunc,props.fn.getBackStepFunc
);
2. 子组件
定义函数:
export default function (resolveApproveFunc: Function,getApproveStepsFunc?: Function,getBackStepFunc?: Function
) {const approvePost = async (businessId: string,data: Object,successCb: () => void,failCb?: () => void) => {const loading2 = ElLoading.service({});try {const { Code, Message } = await resolveApproveFunc(b