Welcome toVigges Developer Community-Open, Learning,Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
2.6k views
in Technique[技术] by (71.8m points)

javascript - React antd Typography.Paragraph ellipsis, how to keep ellipsis symbol, but forbid expand

I am using the <Typography.Paragraph> from antd to display a paragraph, and the requirement is I need to limit the row to 5, and 'more' symbol at the end.

The tricky part is when I click 'more', the para should not expand, instead of display a modal. Display the modal does not struggle me, onExpandcan do that, but to keep the symbol and meanwhile forbid expand do really stumped me.

The api doc is defined here

snippet of the code is shown below

<>
    <Paragraph ellipsis={{ rows: 5, expandable: true, symbol: 'more'}}>
    This course introduces system analysis and design as a problem-solving process, focusing on the development of new and existing information systems. It requires a unique set of skills and knowledge of information systems as well as the business area-skills that are in high demand in industry. This course allows students to understand various system development methods, as well as in-depth understanding and experience in system design and implementation of demand analysis and modeling. Including business structured analysis and design; data analysis and design; object-oriented analysis and design; testing and quality assurance; practical team experience with computer-aided software engineering tools for commercial applications
    </Paragraph>
  </>

and the end of the para is like this enter image description here

I want to keep symbol: 'more', and forbid expand, but if I set expandable: false, the symbol would disappear, just ellipsis left, it seems like a unsolvable conflict.

How can I achieve this, or if there any other component in antd can do this, or any other method besides antd? I greatly appreciate your help


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)
等待大神答复

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to Vigges Developer Community for programmer and developer-Open, Learning and Share
...