feat(editor): props-service支持通过fill-config设置label-width

This commit is contained in:
roymondchen 2024-03-04 14:18:21 +08:00
parent 0e314ef5ad
commit 0315389ce9
3 changed files with 6 additions and 9 deletions

View File

@ -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; }
* };

View File

@ -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');
}
/**

View File

@ -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: [
// 组件类型,必须要有
{