【发布时间】:2019-09-29 00:39:00
【问题描述】:
我正在使用<Typography.Paragraph> 组件来显示列表中某些项目的描述。我想将描述中的行数限制为 2。
现在我可以使用<Typography.Paragraph> 的ellipsis 属性将描述限制为仅显示2 行并将其设置为可扩展。但是,我似乎无法找到一种方法将文本折叠回仅有 2 行的省略号 (...)
这是我当前代码的 sn-p。
const listOfLongText = [.....];
listOfLongText.map((text,i) => {
<Paragraph ellipsis={{ rows: 2, expandable: true }}>
{text}
</Paragraph>
})
我知道 ellipsis 的 Paragraph 属性的 onExpand 回调,但不知道如何使用 onExpand 在展开和折叠功能之间进行切换
<Typography.Paragraph> API 定义为 here
如果您需要更多信息,请发表评论,我会提供。
【问题讨论】: