mirror of
https://github.com/certd/certd.git
synced 2026-04-14 12:30:54 +08:00
18 lines
346 B
TypeScript
18 lines
346 B
TypeScript
import _ from "lodash-es";
|
|
import { compute } from "@fast-crud/fast-crud";
|
|
|
|
export function useReference(form: any) {
|
|
if (!form.reference) {
|
|
return;
|
|
}
|
|
for (const reference of form.reference) {
|
|
_.set(
|
|
form,
|
|
reference.dest,
|
|
compute<any>((scope) => {
|
|
return _.get(scope, reference.src);
|
|
})
|
|
);
|
|
}
|
|
}
|