mirror of
https://gitee.com/nocobase/nocobase.git
synced 2025-05-05 21:49:25 +08:00
refactor(form): optimize useDataFormItemProps hook (#5484)
This commit is contained in:
parent
48f1827f94
commit
f7a368f802
@ -8,9 +8,10 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
import { useForm } from '@formily/react';
|
import { useForm } from '@formily/react';
|
||||||
|
import { useCollectionRecordData } from '../../../../../data-source/collection-record/CollectionRecordProvider';
|
||||||
import { useSatisfiedActionValues } from '../../../../../schema-settings/LinkageRules/useActionValues';
|
import { useSatisfiedActionValues } from '../../../../../schema-settings/LinkageRules/useActionValues';
|
||||||
export function useDataFormItemProps() {
|
export function useDataFormItemProps() {
|
||||||
const form = useForm();
|
const data = useCollectionRecordData();
|
||||||
const { valueMap: style } = useSatisfiedActionValues({ category: 'style', formValues: form?.values });
|
const { valueMap: style } = useSatisfiedActionValues({ category: 'style', formValues: data });
|
||||||
return { wrapperStyle: style };
|
return { wrapperStyle: style };
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user