fix: tts show error message
This commit is contained in:
@@ -2,9 +2,13 @@
|
||||
display: flex;
|
||||
justify-content: flex-start;
|
||||
align-items: center;
|
||||
color: rgba(0, 0, 0, 45%);
|
||||
font-size: var(--font-size-base);
|
||||
|
||||
.note-info {
|
||||
margin-left: 4px;
|
||||
}
|
||||
|
||||
.star {
|
||||
position: relative;
|
||||
top: 2px;
|
||||
|
||||
@@ -1,8 +1,8 @@
|
||||
import { ParamsSchema } from '@/pages/playground/config/types';
|
||||
import { useIntl } from '@umijs/max';
|
||||
import React, { useCallback, useMemo } from 'react';
|
||||
import LabelInfo from './components/label-info';
|
||||
import componentsMap from './config/components';
|
||||
|
||||
const FieldComponent: React.FC<ParamsSchema> = (props) => {
|
||||
const intl = useIntl();
|
||||
const { type, label, attrs, style, value, ...rest } = props;
|
||||
@@ -10,7 +10,16 @@ const FieldComponent: React.FC<ParamsSchema> = (props) => {
|
||||
(type: string) => {
|
||||
switch (type) {
|
||||
case 'Checkbox':
|
||||
return <span>{intl.formatMessage({ id: label.text })}</span>;
|
||||
return (
|
||||
<LabelInfo
|
||||
required={props.required}
|
||||
label={
|
||||
label.isLocalized
|
||||
? intl.formatMessage({ id: label.text })
|
||||
: label.text
|
||||
}
|
||||
></LabelInfo>
|
||||
);
|
||||
default:
|
||||
return null;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user