import React, { useState } from 'react'; import { Button, Slider, Switch, Typography } from 'antd'; const { Text, Paragraph } = Typography; const templateStr = 'In the process of internal desktop applications development, many different design specs and implementations would be involved, which might cause designers and developers difficulties and duplication and reduce the efficiency of development.'; const text = `this is a multiline text that has many lines and - render like this - and this and that`; const App: React.FC = () => { const [rows, setRows] = useState(1); const [longText, setLongText] = useState(true); const [copyable, setCopyable] = useState(false); const [editable, setEditable] = useState(false); const [expandable, setExpandable] = useState(false); const [display, setDisplay] = useState('none'); React.useEffect(() => { setTimeout(() => { setDisplay('block'); }, 100); }, []); return ( <> {longText ? ( Ant Design, a design language for background applications, is refined by Ant UED Team. This is a nest sample{' '} Test {' '} case. Bnt Design, a design language for background applications, is refined by Ant UED Team. Cnt Design, a design language for background applications, is refined by Ant UED Team. Dnt Design, a design language for background applications, is refined by Ant UED Team. Ent Design, a design language for background applications, is refined by Ant UED Team. ) : ( Hello World )} {templateStr}
{templateStr}
{templateStr}
Ant Design is a design language for background applications, is refined by Ant UED Team.

[Before]not ellipsis[After]

默认display none 样式的超长文字, 悬停tooltip失效了
Open, }} > {templateStr.slice(0, 60)} ANTD {templateStr.slice(60)}
        {text}
      

{templateStr} ); }; export default App;