Skip to content

Commit f3b58ae

Browse files
author
杨楠
committed
fix:解决 Ellipsis 报错问题
1 parent 395a2c5 commit f3b58ae

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

packages/core/src/Ellipsis/index.tsx

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,12 +14,13 @@ export interface EllipsisProps extends TextProps {
1414

1515
export default function Ellipsis({ maxLen, children, placeholder, ...props }: EllipsisProps) {
1616
const [modalVisible, setModalVisible] = useState(false);
17+
// let content1 = Number(children.length);
1718

1819
let content = children;
19-
let content1 = children;
2020
if (maxLen && content && typeof content === 'string') {
2121
content = content.length > maxLen ? content.substr(0, maxLen) + placeholder : content;
2222
}
23+
2324
return (
2425
<>
2526
<MaskLayer visible={modalVisible} onDismiss={() => setModalVisible(false)}>
@@ -29,7 +30,7 @@ export default function Ellipsis({ maxLen, children, placeholder, ...props }: El
2930
justifyContent: 'center',
3031
alignItems: 'center',
3132
marginTop: MainHeight * 0.2,
32-
height: children.length + 30,
33+
padding: 20,
3334
}}
3435
>
3536
<Text style={{ fontSize: 17 }}>{children}</Text>

0 commit comments

Comments
 (0)