mirror of
https://github.com/cool-team-official/cool-admin-vue.git
synced 2026-03-24 06:22:26 +00:00
27 lines
414 B
TypeScript
27 lines
414 B
TypeScript
export function useFormApi({ refs }: any) {
|
|
const apis: any = {};
|
|
|
|
[
|
|
"showLoading",
|
|
"hiddenLoading",
|
|
"collapseItem",
|
|
"getForm",
|
|
"setForm",
|
|
"setData",
|
|
"setOptions",
|
|
"toggleItem",
|
|
"hiddenItem",
|
|
"showItem",
|
|
"resetFields",
|
|
"clearValidate",
|
|
"validateField",
|
|
"validate"
|
|
].forEach((e) => {
|
|
apis[e] = (...args: any[]) => {
|
|
return refs.value.form[e](...args);
|
|
};
|
|
});
|
|
|
|
return apis;
|
|
}
|