justify-content.uvue 2.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273
  1. <template>
  2. <!-- #ifdef APP -->
  3. <scroll-view style="flex: 1">
  4. <!-- #endif -->
  5. <view style="flex-grow: 1">
  6. <view>
  7. <text>justify-content: center</text>
  8. <view class="common" style="justify-content: 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>justify-content: flex-start</text>
  16. <view class="common" style="justify-content: 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>justify-content: flex-end</text>
  24. <view class="common" style="justify-content: 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>justify-content: space-between</text>
  32. <view class="common" style="justify-content: space-between">
  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. <text>justify-content: space-around</text>
  40. <view class="common" style="justify-content: space-around">
  41. <view style="width: 50px; height: 50px; background-color: red"></view>
  42. <view style="width: 50px; height: 50px; background-color: green"></view>
  43. <view style="width: 50px; height: 50px; background-color: blue"></view>
  44. </view>
  45. </view>
  46. <view>
  47. <text>justify-content: space-evenly </text>
  48. <view class="common" style="justify-content: space-evenly">
  49. <view style="width: 50px; height: 50px; background-color: red"></view>
  50. <view style="width: 50px; height: 50px; background-color: green"></view>
  51. <view style="width: 50px; height: 50px; background-color: blue"></view>
  52. </view>
  53. </view>
  54. </view>
  55. <!-- #ifdef APP -->
  56. </scroll-view>
  57. <!-- #endif -->
  58. </template>
  59. <style>
  60. .common {
  61. width: 250px;
  62. height: 250px;
  63. background-color: gray;
  64. flex-direction: row;
  65. }
  66. </style>