Set element height in vue

there are two columns div, on the left is a list pulled back according to the background interface, and on the right is the content. If you want to set the height of two columns, my idea is to get the element height and set the height of two columns, but if you set it in the call interface, update the list, but the element height is not actually available, so there is no way to solve it, or can you set

:

through css?
Mar.13,2021

this type of problem is called contour layout, and there are many solutions. I have one here: padding compensation method. First, set the padding-bottom of the column to a large enough value, and then set the margin-bottom of the column to a negative value offset by the positive value of the previous padding-bottom. The parent container is set to exceed the hidden value, so that the height of the child container is still the height of the column in which the padding-bottom is not set. When the height of any column in it increases, the height of the parent container is propped up to the height of the highest column in it. Other columns shorter than this column will use their padding-bottom to compensate for this height difference. Because the background can be used in the space occupied by the padding, and the border changes with the padding, a cover is successfully completed.


the height on the right is set to 100%

then the height of the parent element on the left and right is determined by the list on the left, code:

.par {
    height: auto;
}
.right {
    height: 100%;
}
Menu