flex-direction.uvue 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. <template>
  2. <!-- #ifdef APP -->
  3. <scroll-view style="flex: 1">
  4. <!-- #endif -->
  5. <view style="flex-grow: 1">
  6. <view>
  7. <text>flex-direction: row</text>
  8. <view class="common" style="flex-direction: row">
  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>flex-direction: row-reverse</text>
  16. <view class="common" style="flex-direction: row-reverse">
  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>flex-direction: column</text>
  24. <view class="common" style="flex-direction: column">
  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>flex-direction: column-reverse</text>
  32. <view class="common" style="flex-direction: column-reverse">
  33. <view style="width: 50px; height: 50px; background-color: red"></view>
  34. <view style="width: 50px; height: 50px; background-color: green"></view>
  35. <view style="width: 50px; height: 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. }
  49. </style>