Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

What if you use the Descriptions of antd to report an error warning

2025-01-18 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >

Share

Shulou(Shulou.com)06/03 Report--

This article mainly shows you the "use of antd Descriptions error warning how to do", the content is easy to understand, clear, hope to help you solve doubts, the following let the editor lead you to study and learn "using antd Descriptions error warning how to do" this article.

The requirement requires two content to be displayed on a single line, and I use the Descriptions component of antd. Image.png .

Descriptions.Item for traversal

Post the code:

``

{

BaseOrderMsg.map (item= > {

Const {title,desc,id} = item

Return (

{desc}

)

})

}

``

Set the span= {2} page to display 2 contents in one row, but there is a warning prompt on the console:

React_devtools_backend.js:6Warning: [antd: Descriptions] SumofcolumnspaninalineexceedscolumnofDescriptions.

Image.png

How to modify it so that you can not report the prompt error, but also can display 2 contents in one line?

How does Descriptions solve it?

Antdcolmun defaults to 3

Span= {2} wrote two, and the calculation is estimated to be the sum of the values of the two, exceeding the default value of colmun.

Just write one more span= {2} and get rid of one.

Because each span= {2} when looping, this also depends on the length of the array baseOrderMsg. These warnings exceed the length of Descriptions's column. Column defaults to 3. If you want to display two contents in a row, you need to set column to 4.

The above is all the contents of the article "how to use antd's Descriptions to report an error warning". Thank you for reading! I believe we all have a certain understanding, hope to share the content to help you, if you want to learn more knowledge, welcome to follow the industry information channel!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Development

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report