mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-05 01:19:45 +08:00
47 lines
1.9 KiB
TypeScript
47 lines
1.9 KiB
TypeScript
|
import React, { useState } from 'react';
|
||
|
import { Switch, Typography } from 'antd';
|
||
|
|
||
|
const { Paragraph, Text } = Typography;
|
||
|
|
||
|
const App: React.FC = () => {
|
||
|
const [ellipsis, setEllipsis] = useState(true);
|
||
|
|
||
|
return (
|
||
|
<>
|
||
|
<Switch
|
||
|
checked={ellipsis}
|
||
|
onChange={() => {
|
||
|
setEllipsis(!ellipsis);
|
||
|
}}
|
||
|
/>
|
||
|
|
||
|
<Paragraph ellipsis={ellipsis}>
|
||
|
Ant Design, a design language for background applications, is refined by Ant UED Team. Ant
|
||
|
Design, a design language for background applications, is refined by Ant UED Team. Ant
|
||
|
Design, a design language for background applications, is refined by Ant UED Team. Ant
|
||
|
Design, a design language for background applications, is refined by Ant UED Team. Ant
|
||
|
Design, a design language for background applications, is refined by Ant UED Team. Ant
|
||
|
Design, a design language for background applications, is refined by Ant UED Team.
|
||
|
</Paragraph>
|
||
|
|
||
|
<Paragraph ellipsis={ellipsis ? { rows: 2, expandable: true, symbol: 'more' } : false}>
|
||
|
Ant Design, a design language for background applications, is refined by Ant UED Team. Ant
|
||
|
Design, a design language for background applications, is refined by Ant UED Team. Ant
|
||
|
Design, a design language for background applications, is refined by Ant UED Team. Ant
|
||
|
Design, a design language for background applications, is refined by Ant UED Team. Ant
|
||
|
Design, a design language for background applications, is refined by Ant UED Team. Ant
|
||
|
Design, a design language for background applications, is refined by Ant UED Team.
|
||
|
</Paragraph>
|
||
|
|
||
|
<Text
|
||
|
style={ellipsis ? { width: 100 } : undefined}
|
||
|
ellipsis={ellipsis ? { tooltip: 'I am ellipsis now!' } : false}
|
||
|
>
|
||
|
Ant Design, a design language for background applications, is refined by Ant UED Team.
|
||
|
</Text>
|
||
|
</>
|
||
|
);
|
||
|
};
|
||
|
|
||
|
export default App;
|