FAQ for column and span for descriptions components
#4255
Unanswered
zhangpaopao0609
asked this question in
Q&A
Replies: 1 comment
-
|
👋 @zhangpaopao0609,感谢给 TDesign 提出了 issue。 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Here I will first pose the questions and case, and then give a full response for above.
Q1. Is there any relationship between
columnandspan?CASE: In our document,
columnrefers to the "count ofDescriptionItemin one row". Therefore, can I assume that if I set thecolumnto 3, it will consistently render 3DescriptionItemsin one row under any circumstances?However, based on my testing:
This is true when the items do not set a
spanproperty.However, when I set the
spanof the first item to 10, something goes wrong.It only renders the first item in the first row.
So, there must be some relationship between
columnand span, but our document doesn't mention anything about it.Q2. Does the
layoutaffect thecolumnorspan?Q3. Does
item-layoutalso affect thecolumnorspan?Q4. How can I evenly distribute multiple items in a row?
CASE:
ANSWER:
column: This determines how many items will be rendered in each row, but it is affected bylayoutanditem-layout.layoutis set tovertical: Each row will render one item, and thecolumnandspanproperties will be invalid.itemLayoutis set tovertical: if column is set to 3, each row will render 3 items, and in HTML, 3tdelements will be renderedtdelements will be rendered. This is because whenitem-layoutis set tohorizontal, each item consists of 2tdelements (one for the label and one for the content).span: In fact, it is an alias ofcolspan, so it determines how manytdelements this item will occupy in thistr. However, it is also affected bylayoutanditem-layout.layoutis set tovertical: It behaves the same ascolumn.item-layoutis set tovertical:spandirectly corresponds tocolspan. If you setspanto 3, then this item will occupy 3tdelements in HTML. (both label and content will be 3)spanto 3, then this item will occupy 6tdelements in HTML. (The label will be 1 and the content will be 5)The component will automatically calculate the total span amount for each row. If the span number exceeds the
tdnumber, it will automatically layout to the next row. For example, if bothlayoutanditem-layoutare set to their default values, and you setcolumnto 3, and set the first itemspanto 2, you will find that there are only two items in the first row. This is because thedescriptionscomponent will automatically calculate the span amount and adjust the layout accordingly.Unfortunately, we haven't added this feature yet, but we are currently working on it. It will be available soon.
[Descriptions] support evenly distribute multiple items in a row #4253
TODO
[ ]
descriptionscomponents document need more descriptions for column and span.Beta Was this translation helpful? Give feedback.
All reactions