将v-row放在v-tab-item的末尾位置。

huangapple go评论85阅读模式
英文:

How to position a v-row at the end of a v-tab-item

问题

I currently have a v-tab vuetify and inside it a v-tab-item containing three v-rows. I'm trying to align the last v-row to the end of the container as shown in the attached image.

将v-row放在v-tab-item的末尾位置。

Below is the code example:

  1. <v-container class="pa-0">
  2. <v-card flat>
  3. <v-tabs fixed-tabs>
  4. <v-tab>
  5. tab 1
  6. </v-tab>
  7. <v-tab>
  8. tab 2
  9. </v-tab>
  10. <v-tab-item>
  11. <v-row
  12. style="border: 2px solid red;"
  13. no-gutters
  14. >
  15. <v-col>
  16. Lorem ipsum...
  17. </v-col>
  18. </v-row>
  19. <v-row
  20. style="border: 2px solid purple;"
  21. no-gutters
  22. >
  23. <v-col>
  24. Lorem ipsum...
  25. </v-col>
  26. </v-row>
  27. <v-row
  28. style="border: 2px solid orange;"
  29. no-gutters
  30. >
  31. <v-col>
  32. Lorem ipsum...
  33. </v-col>
  34. </v-row>
  35. </v-tab-item>
  36. </v-tabs>
  37. </v-card>
  38. </v-container>
英文:

I currently have a v-tab vuetify and inside it a v-tab-item containing three v-rows. I'm trying to align the last v-row to the end of the container as shown in the attached image.

将v-row放在v-tab-item的末尾位置。

Below is the code example

  1. &lt;v-container class=&quot;pa-0&quot;&gt;
  2. &lt;v-card flat&gt;
  3. &lt;v-tabs fixed-tabs&gt;
  4. &lt;v-tab&gt;
  5. tab 1
  6. &lt;/v-tab&gt;
  7. &lt;v-tab&gt;
  8. tab 2
  9. &lt;/v-tab&gt;
  10. &lt;v-tab-item&gt;
  11. &lt;v-row
  12. style=&quot;border: 2px solid red;&quot;
  13. no-gutters
  14. &gt;
  15. &lt;v-col&gt;
  16. Lorem ipsum...
  17. &lt;/v-col&gt;
  18. &lt;/v-row&gt;
  19. &lt;v-row
  20. style=&quot;border: 2px solid purple;&quot;
  21. no-gutters
  22. &gt;
  23. &lt;v-col&gt;
  24. Lorem ipsum...
  25. &lt;/v-col&gt;
  26. &lt;/v-row&gt;
  27. &lt;v-row
  28. style=&quot;border: 2px solid orange;&quot;
  29. no-gutters
  30. &gt;
  31. &lt;v-col&gt;
  32. Lorem ipsum...
  33. &lt;/v-col&gt;
  34. &lt;/v-row&gt;
  35. &lt;/v-tab-item&gt;
  36. &lt;/v-tabs&gt;
  37. &lt;/v-card&gt;
  38. &lt;/v-container&gt;

答案1

得分: 1

  1. 将属于顶部和底部的行分别包装在不同的div中,然后将父元素设置为flex列布局,并使用justify space-between
  2. ```css
  3. .row-container {
  4. height: calc(100vh - 48px);
  5. display: flex;
  6. flex-direction: column;
  7. justify-content: space-between;
  8. }
英文:

Wrap the rows that belong at the top and at the bottom in different divs, then make the parent a flex column with justify space-between

  1. &lt;v-tab-item class=&quot;row-container&quot;&gt;
  2. &lt;div class=&quot;top-rows&quot;&gt;
  3. &lt;v-row style=&quot;border: 2px solid red&quot; no-gutters&gt;
  4. &lt;v-col&gt; Lorem ipsum... &lt;/v-col&gt;
  5. &lt;/v-row&gt;
  6. &lt;v-row style=&quot;border: 2px solid purple&quot; no-gutters&gt;
  7. &lt;v-col&gt; Lorem ipsum... &lt;/v-col&gt;
  8. &lt;/v-row&gt;
  9. &lt;/div&gt;
  10. &lt;div class=&quot;bottom-rows&quot;&gt;
  11. &lt;v-row style=&quot;border: 2px solid orange&quot; no-gutters&gt;
  12. &lt;v-col&gt; Lorem ipsum... &lt;/v-col&gt;
  13. &lt;/v-row&gt;
  14. &lt;/div&gt;
  15. &lt;/v-tab-item&gt;
  1. .row-container {
  2. height: calc(100vh - 48px);
  3. display: flex;
  4. flex-direction: column;
  5. justify-content: space-between;
  6. }

codepen example

huangapple
  • 本文由 发表于 2023年5月11日 03:17:09
  • 转载请务必保留本文链接:https://go.coder-hub.com/76221898.html
匿名

发表评论

匿名网友

:?: :razz: :sad: :evil: :!: :smile: :oops: :grin: :eek: :shock: :???: :cool: :lol: :mad: :twisted: :roll: :wink: :idea: :arrow: :neutral: :cry: :mrgreen:

确定