mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-13 09:41:57 +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 { ComponentMetadata, FieldConfig, InitialItem, FilterItem, AutorunItem } from '@ali/lowcode-types';
|
||||
import { ComponentMetadata, FieldConfig, InitialItem, FilterItem, AutorunItem, isI18nData } from '@ali/lowcode-types';
|
||||
import {
|
||||
ComponentMeta,
|
||||
addBuiltinComponentAction,
|
||||
@ -259,12 +259,14 @@ class Prototype {
|
||||
}
|
||||
|
||||
getTitle(currentLocale?: string) {
|
||||
if (currentLocale && this.meta.title[currentLocale]) {
|
||||
return this.meta.title[currentLocale];
|
||||
}
|
||||
const locale = globalLocale.getLocale();
|
||||
if (this.meta.title && this.meta.title.type === 'i18n') {
|
||||
return this.meta.title[locale] || this.meta.title;
|
||||
if (isI18nData(this.meta.title)) {
|
||||
if (currentLocale && this.meta.title[currentLocale]) {
|
||||
return this.meta.title[currentLocale];
|
||||
}
|
||||
const locale = globalLocale.getLocale();
|
||||
if (this.meta.title && this.meta.title.type === 'i18n') {
|
||||
return this.meta.title[locale] || this.meta.title;
|
||||
}
|
||||
}
|
||||
|
||||
return this.meta.title;
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user