align-items.uvue 1.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <template>
  2. <!-- #ifdef APP -->
  3. <scroll-view style="flex: 1">
  4. <!-- #endif -->
  5. <view style="flex-grow: 1">
  6. <view>
  7. <text>align-items: center</text>
  8. <view class="common" style="align-items: center">
  9. <view style="width: 50px; height: 50px; background-color: red"></view>
  10. <view style="width: 50px; height: 50px; background-color: green"></view>
  11. <view style="width: 50px; height: 50px; background-color: blue"></view>
  12. </view>
  13. </view>
  14. <view>
  15. <text>align-items: flex-start</text>
  16. <view class="common" style="align-items: flex-start">
  17. <view style="width: 50px; height: 50px; background-color: red"></view>
  18. <view style="width: 50px; height: 50px; background-color: green"></view>
  19. <view style="width: 50px; height: 50px; background-color: blue"></view>
  20. </view>
  21. </view>
  22. <view>
  23. <text>align-items: flex-end</text>
  24. <view class="common" style="align-items: flex-end">
  25. <view style="width: 50px; height: 50px; background-color: red"></view>
  26. <view style="width: 50px; height: 50px; background-color: green"></view>
  27. <view style="width: 50px; height: 50px; background-color: blue"></view>
  28. </view>
  29. </view>
  30. <view>
  31. <text>align-items: stretch</text>
  32. <view class="common" style="align-items: stretch">
  33. <view style="width: 50px; background-color: red"></view>
  34. <view style="width: 50px; background-color: green"></view>
  35. <view style="width: 50px; background-color: blue"></view>
  36. </view>
  37. </view>
  38. </view>
  39. <!-- #ifdef APP -->
  40. </scroll-view>
  41. <!-- #endif -->
  42. </template>
  43. <style>
  44. .common {
  45. width: 250px;
  46. height: 250px;
  47. background-color: gray;
  48. flex-direction: row;
  49. }
  50. </style>