refactor: hook name should start with 'use'

This commit is contained in:
Rairn 2023-03-11 11:55:39 +08:00
parent fe652bf6e8
commit bc25467027
2 changed files with 4 additions and 4 deletions

View File

@ -19,7 +19,7 @@ export const TableBlockDesigner = () => {
const sortFields = useSortFields(name);
const { service } = useTableBlockContext();
const { t } = useTranslation();
const { dn, refresh } = useDesignable();
const { dn } = useDesignable();
const defaultFilter = fieldSchema?.['x-decorator-props']?.params?.filter || {};
const defaultSort = fieldSchema?.['x-decorator-props']?.params?.sort || [];
const defaultResource = fieldSchema?.['x-decorator-props']?.resource;

View File

@ -19,9 +19,9 @@ const supportsType = [
'multipleSelect',
'oho',
'obo',
'm2o'
'm2o',
];
const VariableTypes = (currentCollection) => {
const useVariableTypes = (currentCollection) => {
const { getCollectionFields, getInterface, getCollection } = useCollectionManager();
const collection = getCollection(currentCollection);
const fields = getCollectionFields(currentCollection);
@ -91,7 +91,7 @@ const VariableTypes = (currentCollection) => {
export function useVariableOptions(collectionName) {
const compile = useCompile();
const options = VariableTypes(collectionName).map((item: any) => {
const options = useVariableTypes(collectionName).map((item) => {
const options = typeof item.options === 'function' ? item.options() : item.options;
return {
label: compile(item.title),