mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-04-06 03:57:56 +08:00
feat(editor): props-service支持通过fill-config设置label-width
This commit is contained in:
parent
0e314ef5ad
commit
0315389ce9
@ -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; }
|
||||
* };
|
||||
|
@ -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');
|
||||
}
|
||||
|
||||
/**
|
||||
|
@ -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: [
|
||||
// 组件类型,必须要有
|
||||
{
|
||||
|
Loading…
x
Reference in New Issue
Block a user