mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 03:46:08 +00:00
fix: menu modifications do not take effect in real-time (#5207)
* fix: menu modifications do not take effect in real-time * fix: bug
This commit is contained in:
parent
db57b21e1a
commit
4399856eae
@ -272,7 +272,7 @@ export const MenuDesigner = () => {
|
||||
title: field.title,
|
||||
icon: field.componentProps.icon,
|
||||
};
|
||||
}, [field]);
|
||||
}, [field.title, field.componentProps.icon]);
|
||||
if (fieldSchema['x-component'] === 'Menu.URL') {
|
||||
schema.properties['href'] = urlSchema;
|
||||
schema.properties['params'] = paramsSchema;
|
||||
@ -364,7 +364,6 @@ export const MenuDesigner = () => {
|
||||
title: t('Delete menu item'),
|
||||
};
|
||||
}, [t]);
|
||||
|
||||
return (
|
||||
<GeneralSchemaDesigner>
|
||||
<SchemaSettingsModalItem
|
||||
|
@ -267,7 +267,6 @@ const HeaderMenu = ({
|
||||
},
|
||||
[schema, mode, onSelect, setLoading, setDefaultSelectedKeys],
|
||||
);
|
||||
|
||||
return (
|
||||
<>
|
||||
<Component />
|
||||
@ -530,14 +529,14 @@ Menu.Item = observer(
|
||||
removeParentsIfNoChildren={false}
|
||||
>
|
||||
<Icon type={icon} />
|
||||
<span style={menuItemTitleStyle}>{t(field.title)}</span>
|
||||
<span style={menuItemTitleStyle}>{t(schema.title)}</span>
|
||||
<Designer />
|
||||
</SortableItem>
|
||||
</FieldContext.Provider>
|
||||
</SchemaContext.Provider>
|
||||
),
|
||||
};
|
||||
}, [field.title, icon, schema, Designer]);
|
||||
}, [schema.title, icon, schema, Designer]);
|
||||
|
||||
if (!pushMenuItem) {
|
||||
error('Menu.Item must be wrapped by GetMenuItemsContext.Provider');
|
||||
|
@ -35,12 +35,12 @@ export const CustomRequestInitializer: React.FC<any> = (props) => {
|
||||
const customRequestsResource = useCustomRequestsResource();
|
||||
const itemConfig = useSchemaInitializerItem();
|
||||
const { insert } = useSchemaInitializer();
|
||||
const schema = getNewSchema();
|
||||
|
||||
return (
|
||||
<SchemaInitializerItem
|
||||
{...itemConfig}
|
||||
onClick={async () => {
|
||||
const schema = getNewSchema();
|
||||
const s = merge(schema || {}, itemConfig.schema || {});
|
||||
itemConfig?.schemaInitialize?.(s);
|
||||
insert(s);
|
||||
|
Loading…
Reference in New Issue
Block a user