mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-13 09:41:57 +00:00
Merge branch 'hotfix/prototype-getTitle-locale' into 'release/0.9.0'
prototype getTitle 支持 i18n Hotfix/prototype get title locale See merge request !895038
This commit is contained in:
commit
2f10726025
@ -1,5 +1,5 @@
|
||||
import { ComponentType, ReactElement } from 'react';
|
||||
import { ComponentMetadata, FieldConfig, InitialItem, FilterItem, AutorunItem } from '@ali/lowcode-types';
|
||||
import { ComponentMetadata, FieldConfig, InitialItem, FilterItem, AutorunItem, isI18nData } from '@ali/lowcode-types';
|
||||
import {
|
||||
ComponentMeta,
|
||||
addBuiltinComponentAction,
|
||||
@ -15,6 +15,7 @@ import {
|
||||
upgradePropConfig,
|
||||
upgradeConfigure,
|
||||
} from './upgrade-metadata';
|
||||
import { intl } from '@ali/lowcode-editor-core';
|
||||
import { designer } from '../editor';
|
||||
import { uniqueId } from '@ali/lowcode-utils';
|
||||
|
||||
@ -23,7 +24,7 @@ const GlobalPropsConfigure: Array<{
|
||||
initials?: InitialItem[];
|
||||
filters?: FilterItem[];
|
||||
autoruns?: AutorunItem[];
|
||||
config: FieldConfig
|
||||
config: FieldConfig;
|
||||
}> = [];
|
||||
const Overrides: {
|
||||
[componentName: string]: {
|
||||
@ -53,7 +54,7 @@ function addGlobalPropsConfigure(config: OldGlobalPropConfig) {
|
||||
addAutorun: (item) => {
|
||||
autoruns.push(item);
|
||||
},
|
||||
})
|
||||
}),
|
||||
});
|
||||
}
|
||||
function removeGlobalPropsConfigure(name: string) {
|
||||
@ -82,7 +83,7 @@ function overridePropsConfigure(componentName: string, config: { [name: string]:
|
||||
override = upgradeConfigure(config, { addInitial, addFilter, addAutorun });
|
||||
} else {
|
||||
override = {};
|
||||
Object.keys(config).forEach(key => {
|
||||
Object.keys(config).forEach((key) => {
|
||||
override[key] = upgradePropConfig(config[key], { addInitial, addFilter, addAutorun });
|
||||
});
|
||||
}
|
||||
@ -258,7 +259,7 @@ class Prototype {
|
||||
}
|
||||
|
||||
getTitle() {
|
||||
return this.meta.title;
|
||||
return intl(this.meta.title);
|
||||
}
|
||||
|
||||
getComponentName() {
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user