1
0
mirror of synced 2026-03-23 11:18:36 +08:00

style(editor): 完善service use-plugin的ts类型定义

This commit is contained in:
roymondchen
2024-03-05 14:55:41 +08:00
parent 5cf137e5e8
commit 16e45cb45d
16 changed files with 263 additions and 156 deletions

View File

@@ -21,7 +21,7 @@ export const useRuntime = ({
fillConfig = (config) => config,
}: {
plugins?: Plugin[];
fillConfig?: (config: FormConfig) => FormConfig;
fillConfig?: (config: FormConfig, mForm: any) => FormConfig;
} = {}) => {
const render = (stage: StageCore) => {
injectStyle(stage.renderer.getDocument()!, cssStyle);
@@ -60,24 +60,24 @@ export const useRuntime = ({
};
propsService.usePlugin({
afterFillConfig(config: FormConfig, itemConfig: FormConfig) {
async afterFillConfig(config: FormConfig, itemConfig: FormConfig, labelWidth = '80px') {
return [
{
type: 'tab',
items: [
{
title: '属性',
labelWidth: '80px',
labelWidth,
items: [...commonConfig, ...itemConfig],
},
],
},
];
] as FormConfig;
},
});
editorService.usePlugin({
afterGetLayout() {
async afterGetLayout() {
return Layout.RELATIVE;
},
});