获取某组件的引用后还需要去定义type,这样太麻烦了,可以获取setup的返回值类型,这样就方便能推断了.
组件中setup return的内容
方法核心是ts中的ReturnType类型
https://www.typescriptlang.org/docs/handbook/utility-types.html#returntypetype
type partner = Exclude<ReturnType<Required<typeof PartnerInfo>['setup']>, void | RenderFunction | Promise<any>>;