mirror of
https://github.com/ant-design/ant-design.git
synced 2024-11-25 19:50:05 +08:00
1ebf5fa4b7
* feat:Typography add suffix * feat:run test * fix:lint * feat: update suffix example * feat: update test * fix: updateupdateSnapshot * fix: upate test * run lint * feat: measureSuffixText * feat: suffix 不可省略 * fix: title * fix: update node_modules * fix: change title type
969 B
969 B
order | title | ||||
---|---|---|---|---|---|
100 |
|
zh-CN
添加后缀的省略。
en-US
add suffix ellipsis support.
import { Typography, Slider } from 'antd';
const { Paragraph } = Typography;
class Demo extends React.Component {
state = {
rows: 1,
};
onChange = rows => {
this.setState({ rows });
};
render() {
const { rows } = this.state;
const article =
'To be, or not to be, that is a question: Whether it is nobler in the mind to suffer. The slings and arrows of outrageous fortune';
return (
<div>
<Slider value={rows} min={1} max={10} onChange={this.onChange} />
<Paragraph
ellipsis={{
rows,
expandable: true,
suffix: '--William Shakespeare',
}}
title={`${article}--William Shakespeare`}
>
{article}
</Paragraph>
</div>
);
}
}
ReactDOM.render(<Demo />, mountNode);