mirror of
https://github.com/nocobase/nocobase.git
synced 2026-09-19 02:23:00 +08:00
Merge branch 'main' into next
This commit is contained in:
@@ -12,9 +12,9 @@ import React from 'react';
|
||||
import { ClickableFieldModel } from './ClickableFieldModel';
|
||||
|
||||
export class DisplayTextFieldModel extends ClickableFieldModel {
|
||||
t(value: string) {
|
||||
t(value: string | undefined | null) {
|
||||
// 如果 value 是 {{ 开头 }} 结尾,则认为是 i18n 表达式,需要翻译
|
||||
if (value.startsWith('{{') && value.endsWith('}}')) {
|
||||
if (value?.startsWith('{{') && value?.endsWith('}}')) {
|
||||
return this.translate(value);
|
||||
}
|
||||
return value;
|
||||
|
||||
Reference in New Issue
Block a user