mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 11:56:29 +00:00
fix(Calendar): ensur to get correct gridInitializer when adding a new… (#1425)
* fix(Calendar): ensur to get correct gridInitializer when adding a new tab (#1241) * perf: use useMemo
This commit is contained in:
parent
c68caf105e
commit
9ada0e37d6
@ -1,5 +1,5 @@
|
||||
import { useForm } from '@formily/react';
|
||||
import React from 'react';
|
||||
import React, { useMemo } from 'react';
|
||||
import { SchemaComponent, useActionContext, useDesignable, useRecordIndex } from '../..';
|
||||
|
||||
export const TabPaneInitializers = (props?: any) => {
|
||||
@ -46,9 +46,8 @@ export const TabPaneInitializers = (props?: any) => {
|
||||
},
|
||||
};
|
||||
};
|
||||
return (
|
||||
<SchemaComponent
|
||||
schema={{
|
||||
const schema = useMemo(() => {
|
||||
return {
|
||||
type: 'void',
|
||||
properties: {
|
||||
action1: {
|
||||
@ -117,9 +116,9 @@ export const TabPaneInitializers = (props?: any) => {
|
||||
},
|
||||
},
|
||||
},
|
||||
}}
|
||||
/>
|
||||
);
|
||||
};
|
||||
}, []);
|
||||
return <SchemaComponent schema={schema} />;
|
||||
};
|
||||
|
||||
export const TabPaneInitializersForCreateFormBlock = (props) => {
|
||||
|
@ -1008,6 +1008,9 @@ export const createCalendarBlockSchema = (options) => {
|
||||
'x-component': 'Tabs',
|
||||
'x-component-props': {},
|
||||
'x-initializer': 'TabPaneInitializers',
|
||||
'x-initializer-props': {
|
||||
gridInitializer: 'RecordBlockInitializers',
|
||||
},
|
||||
properties: {
|
||||
tab1: {
|
||||
type: 'void',
|
||||
|
Loading…
Reference in New Issue
Block a user