mirror of
https://github.com/nocobase/nocobase
synced 2024-11-15 13:46:45 +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 { useForm } from '@formily/react';
|
||||||
import React from 'react';
|
import React, { useMemo } from 'react';
|
||||||
import { SchemaComponent, useActionContext, useDesignable, useRecordIndex } from '../..';
|
import { SchemaComponent, useActionContext, useDesignable, useRecordIndex } from '../..';
|
||||||
|
|
||||||
export const TabPaneInitializers = (props?: any) => {
|
export const TabPaneInitializers = (props?: any) => {
|
||||||
@ -46,9 +46,8 @@ export const TabPaneInitializers = (props?: any) => {
|
|||||||
},
|
},
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
return (
|
const schema = useMemo(() => {
|
||||||
<SchemaComponent
|
return {
|
||||||
schema={{
|
|
||||||
type: 'void',
|
type: 'void',
|
||||||
properties: {
|
properties: {
|
||||||
action1: {
|
action1: {
|
||||||
@ -117,9 +116,9 @@ export const TabPaneInitializers = (props?: any) => {
|
|||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
}}
|
};
|
||||||
/>
|
}, []);
|
||||||
);
|
return <SchemaComponent schema={schema} />;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const TabPaneInitializersForCreateFormBlock = (props) => {
|
export const TabPaneInitializersForCreateFormBlock = (props) => {
|
||||||
|
@ -1008,6 +1008,9 @@ export const createCalendarBlockSchema = (options) => {
|
|||||||
'x-component': 'Tabs',
|
'x-component': 'Tabs',
|
||||||
'x-component-props': {},
|
'x-component-props': {},
|
||||||
'x-initializer': 'TabPaneInitializers',
|
'x-initializer': 'TabPaneInitializers',
|
||||||
|
'x-initializer-props': {
|
||||||
|
gridInitializer: 'RecordBlockInitializers',
|
||||||
|
},
|
||||||
properties: {
|
properties: {
|
||||||
tab1: {
|
tab1: {
|
||||||
type: 'void',
|
type: 'void',
|
||||||
|
Loading…
Reference in New Issue
Block a user