mirror of
https://github.com/ant-design/ant-design.git
synced 2024-12-22 22:48:29 +08:00
ade622e8f4
* fix: a wrong word * fix: update snapshot
33 lines
1.3 KiB
TypeScript
33 lines
1.3 KiB
TypeScript
import React, { useState } from 'react';
|
|
import { Slider, Typography } from 'antd';
|
|
|
|
const { Paragraph } = Typography;
|
|
|
|
const App: React.FC = () => {
|
|
const [rows, setRows] = useState(1);
|
|
|
|
const article =
|
|
"To be, or not to be, that is the question: Whether it is nobler in the mind to suffer. The slings and arrows of outrageous fortune Or to take arms against a sea of troubles, And by opposing end them? To die: to sleep; No more; and by a sleep to say we end The heart-ache and the thousand natural shocks That flesh is heir to, 'tis a consummation Devoutly to be wish'd. To die, to sleep To sleep- perchance to dream: ay, there's the rub! For in that sleep of death what dreams may come When we have shuffled off this mortal coil, Must give us pause. There 's the respect That makes calamity of so long life";
|
|
|
|
return (
|
|
<>
|
|
<Slider value={rows} min={1} max={10} onChange={setRows} />
|
|
<Paragraph
|
|
ellipsis={{
|
|
rows,
|
|
expandable: true,
|
|
suffix: '--William Shakespeare',
|
|
onEllipsis: (ellipsis) => {
|
|
console.log('Ellipsis changed:', ellipsis);
|
|
},
|
|
}}
|
|
title={`${article}--William Shakespeare`}
|
|
>
|
|
{article}
|
|
</Paragraph>
|
|
</>
|
|
);
|
|
};
|
|
|
|
export default App;
|