mirror of
https://github.com/Tencent/tmagic-editor.git
synced 2025-05-02 15:56:36 +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 {
|
* Class EditorService extends BaseService {
|
||||||
* constructor() {
|
* constructor() {
|
||||||
* super(['add']);
|
* super([ { name: 'add', isAsync: true },]);
|
||||||
* }
|
* }
|
||||||
* add(value) { return result; }
|
* add(value) { return result; }
|
||||||
* };
|
* };
|
||||||
@ -131,7 +131,7 @@ const doAsyncAction = async (
|
|||||||
* 例如:
|
* 例如:
|
||||||
* Class EditorService extends BaseService {
|
* Class EditorService extends BaseService {
|
||||||
* constructor() {
|
* constructor() {
|
||||||
* super(['add']);
|
* super([ { name: 'add', isAsync: true },]);
|
||||||
* }
|
* }
|
||||||
* add(value) { return result; }
|
* add(value) { return result; }
|
||||||
* };
|
* };
|
||||||
|
@ -58,8 +58,8 @@ class Props extends BaseService {
|
|||||||
this.emit('props-configs-change');
|
this.emit('props-configs-change');
|
||||||
}
|
}
|
||||||
|
|
||||||
public async fillConfig(config: FormConfig) {
|
public async fillConfig(config: FormConfig, labelWidth?: string) {
|
||||||
return fillConfig(config);
|
return fillConfig(config, typeof labelWidth !== 'function' ? labelWidth : '80px');
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -41,7 +41,6 @@ const numberOptions = [
|
|||||||
|
|
||||||
export const styleTabConfig: TabPaneConfig = {
|
export const styleTabConfig: TabPaneConfig = {
|
||||||
title: '样式',
|
title: '样式',
|
||||||
labelWidth: '80px',
|
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
name: 'style',
|
name: 'style',
|
||||||
@ -219,13 +218,11 @@ export const advancedTabConfig: TabPaneConfig = {
|
|||||||
{
|
{
|
||||||
name: 'created',
|
name: 'created',
|
||||||
text: 'created',
|
text: 'created',
|
||||||
labelWidth: '100px',
|
|
||||||
type: 'code-select',
|
type: 'code-select',
|
||||||
},
|
},
|
||||||
{
|
{
|
||||||
name: 'mounted',
|
name: 'mounted',
|
||||||
text: 'mounted',
|
text: 'mounted',
|
||||||
labelWidth: '100px',
|
|
||||||
type: 'code-select',
|
type: 'code-select',
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
@ -331,13 +328,13 @@ export const displayTabConfig: TabPaneConfig = {
|
|||||||
* @param config 组件属性配置
|
* @param config 组件属性配置
|
||||||
* @returns Object
|
* @returns Object
|
||||||
*/
|
*/
|
||||||
export const fillConfig = (config: FormConfig = []) => [
|
export const fillConfig = (config: FormConfig = [], labelWidth = '80px') => [
|
||||||
{
|
{
|
||||||
type: 'tab',
|
type: 'tab',
|
||||||
|
labelWidth,
|
||||||
items: [
|
items: [
|
||||||
{
|
{
|
||||||
title: '属性',
|
title: '属性',
|
||||||
labelWidth: '80px',
|
|
||||||
items: [
|
items: [
|
||||||
// 组件类型,必须要有
|
// 组件类型,必须要有
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user