mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-18 13:28:24 +00:00
fix: 🐛 用 isI18nData 判断 meta title
This commit is contained in:
parent
927c8f22fd
commit
732bccffde
@ -1,5 +1,5 @@
|
|||||||
import { ComponentType, ReactElement } from 'react';
|
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 {
|
import {
|
||||||
ComponentMeta,
|
ComponentMeta,
|
||||||
addBuiltinComponentAction,
|
addBuiltinComponentAction,
|
||||||
@ -259,6 +259,7 @@ class Prototype {
|
|||||||
}
|
}
|
||||||
|
|
||||||
getTitle(currentLocale?: string) {
|
getTitle(currentLocale?: string) {
|
||||||
|
if (isI18nData(this.meta.title)) {
|
||||||
if (currentLocale && this.meta.title[currentLocale]) {
|
if (currentLocale && this.meta.title[currentLocale]) {
|
||||||
return this.meta.title[currentLocale];
|
return this.meta.title[currentLocale];
|
||||||
}
|
}
|
||||||
@ -266,6 +267,7 @@ class Prototype {
|
|||||||
if (this.meta.title && this.meta.title.type === 'i18n') {
|
if (this.meta.title && this.meta.title.type === 'i18n') {
|
||||||
return this.meta.title[locale] || this.meta.title;
|
return this.meta.title[locale] || this.meta.title;
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return this.meta.title;
|
return this.meta.title;
|
||||||
}
|
}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user