+
- {isActive ? '收起' : '展开'}
+ {isActive ? '收起' : '展开'}
);
};
return (
setActiveKey(activeKey ? '' : 'single')}
>
-
+
{children}
diff --git a/packages/data-render/src/widgets/components/Encryption/index.tsx b/packages/data-render/src/widgets/components/Encryption/index.tsx
index d04f7d51a..089771c20 100644
--- a/packages/data-render/src/widgets/components/Encryption/index.tsx
+++ b/packages/data-render/src/widgets/components/Encryption/index.tsx
@@ -1,6 +1,7 @@
import React from 'react';
import classnames from 'classnames';
import createIconFont from '../../utils/createIconFont';
+import { renderString } from '../../utils/common';
import CopyLabel from '../CopyLabel';
import './index.less';
@@ -35,17 +36,17 @@ const Encryption = (props: IProps) => {
return (
- {label && {label}}
+ {label && {renderString(label)}}
{data &&
(copy ? (
) : (
- {data}
+ {data}
))}
{!data && (
{type && }
- {showText && {text}}
+ {showText && {text}}
)}
diff --git a/packages/data-render/src/widgets/utils/common.ts b/packages/data-render/src/widgets/utils/common.ts
index f591ee29b..698dfe056 100644
--- a/packages/data-render/src/widgets/utils/common.ts
+++ b/packages/data-render/src/widgets/utils/common.ts
@@ -46,8 +46,8 @@ export const getValueFromKey = (props: {
}): string | boolean => {
const { data, path = '', defaultValue = '', addons, valueType } = props;
- let result = null;
- let negation = null; // 否定标识 !
+ let result: any = null;
+ let negation: any = null; // 否定标识 !
let dataPath = path;
if (path.substring(0, 2) === '!!') {
@@ -311,3 +311,11 @@ export const transDataKeyToData = (object: any, { data, addons }: any) => {
}
});
};
+
+
+export const renderString = (str: any) => {
+ if (isObject(str)) {
+ return '';
+ }
+ return str;
+}
\ No newline at end of file