diff --git a/packages/editor/src/services/BaseService.ts b/packages/editor/src/services/BaseService.ts index 22f8a51e..517e3dfc 100644 --- a/packages/editor/src/services/BaseService.ts +++ b/packages/editor/src/services/BaseService.ts @@ -103,7 +103,7 @@ const doAsyncAction = async ( * 例如: * Class EditorService extends BaseService { * constructor() { - * super(['add']); + * super([ { name: 'add', isAsync: true },]); * } * add(value) { return result; } * }; @@ -131,7 +131,7 @@ const doAsyncAction = async ( * 例如: * Class EditorService extends BaseService { * constructor() { - * super(['add']); + * super([ { name: 'add', isAsync: true },]); * } * add(value) { return result; } * }; diff --git a/packages/editor/src/services/props.ts b/packages/editor/src/services/props.ts index 7bdfe01e..342ecb08 100644 --- a/packages/editor/src/services/props.ts +++ b/packages/editor/src/services/props.ts @@ -58,8 +58,8 @@ class Props extends BaseService { this.emit('props-configs-change'); } - public async fillConfig(config: FormConfig) { - return fillConfig(config); + public async fillConfig(config: FormConfig, labelWidth?: string) { + return fillConfig(config, typeof labelWidth !== 'function' ? labelWidth : '80px'); } /** diff --git a/packages/editor/src/utils/props.ts b/packages/editor/src/utils/props.ts index 0f343e6a..3a8abf2a 100644 --- a/packages/editor/src/utils/props.ts +++ b/packages/editor/src/utils/props.ts @@ -41,7 +41,6 @@ const numberOptions = [ export const styleTabConfig: TabPaneConfig = { title: '样式', - labelWidth: '80px', items: [ { name: 'style', @@ -219,13 +218,11 @@ export const advancedTabConfig: TabPaneConfig = { { name: 'created', text: 'created', - labelWidth: '100px', type: 'code-select', }, { name: 'mounted', text: 'mounted', - labelWidth: '100px', type: 'code-select', }, ], @@ -331,13 +328,13 @@ export const displayTabConfig: TabPaneConfig = { * @param config 组件属性配置 * @returns Object */ -export const fillConfig = (config: FormConfig = []) => [ +export const fillConfig = (config: FormConfig = [], labelWidth = '80px') => [ { type: 'tab', + labelWidth, items: [ { title: '属性', - labelWidth: '80px', items: [ // 组件类型,必须要有 {