flex-flow.uvue 4.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185
  1. <template>
  2. <!-- #ifdef APP -->
  3. <scroll-view style="flex: 1">
  4. <!-- #endif -->
  5. <view style="flex-grow: 1">
  6. <view>
  7. <text>flex-flow: row nowrap</text>
  8. <view class="common" style="flex-flow: row nowrap">
  9. <view style="
  10. width: 50px;
  11. height: 50px;
  12. background-color: red;
  13. flex-shrink: 0;
  14. "></view>
  15. <view style="
  16. width: 50px;
  17. height: 50px;
  18. background-color: green;
  19. flex-shrink: 0;
  20. "></view>
  21. <view style="
  22. width: 50px;
  23. height: 50px;
  24. background-color: blue;
  25. flex-shrink: 0;
  26. "></view>
  27. <view style="
  28. width: 50px;
  29. height: 50px;
  30. background-color: red;
  31. flex-shrink: 0;
  32. "></view>
  33. <view style="
  34. width: 50px;
  35. height: 50px;
  36. background-color: green;
  37. flex-shrink: 0;
  38. "></view>
  39. <view style="
  40. width: 50px;
  41. height: 50px;
  42. background-color: blue;
  43. flex-shrink: 0;
  44. "></view>
  45. </view>
  46. </view>
  47. <view>
  48. <text>flex-flow: row wrap</text>
  49. <view class="common" style="flex-flow: row wrap">
  50. <view style="
  51. width: 50px;
  52. height: 50px;
  53. background-color: red;
  54. flex-shrink: 0;
  55. "></view>
  56. <view style="
  57. width: 50px;
  58. height: 50px;
  59. background-color: green;
  60. flex-shrink: 0;
  61. "></view>
  62. <view style="
  63. width: 50px;
  64. height: 50px;
  65. background-color: blue;
  66. flex-shrink: 0;
  67. "></view>
  68. <view style="
  69. width: 50px;
  70. height: 50px;
  71. background-color: red;
  72. flex-shrink: 0;
  73. "></view>
  74. <view style="
  75. width: 50px;
  76. height: 50px;
  77. background-color: green;
  78. flex-shrink: 0;
  79. "></view>
  80. <view style="
  81. width: 50px;
  82. height: 50px;
  83. background-color: blue;
  84. flex-shrink: 0;
  85. "></view>
  86. </view>
  87. </view>
  88. <view>
  89. <text>flex-flow: column nowrap</text>
  90. <view class="common" style="flex-flow: column nowrap">
  91. <view style="
  92. width: 50px;
  93. height: 50px;
  94. background-color: red;
  95. flex-shrink: 0;
  96. "></view>
  97. <view style="
  98. width: 50px;
  99. height: 50px;
  100. background-color: green;
  101. flex-shrink: 0;
  102. "></view>
  103. <view style="
  104. width: 50px;
  105. height: 50px;
  106. background-color: blue;
  107. flex-shrink: 0;
  108. "></view>
  109. <view style="
  110. width: 50px;
  111. height: 50px;
  112. background-color: red;
  113. flex-shrink: 0;
  114. "></view>
  115. <view style="
  116. width: 50px;
  117. height: 50px;
  118. background-color: green;
  119. flex-shrink: 0;
  120. "></view>
  121. <view style="
  122. width: 50px;
  123. height: 50px;
  124. background-color: blue;
  125. flex-shrink: 0;
  126. "></view>
  127. </view>
  128. </view>
  129. <view>
  130. <text>flex-flow: column wrap</text>
  131. <view class="common" style="flex-flow: column wrap">
  132. <view style="
  133. width: 50px;
  134. height: 50px;
  135. background-color: red;
  136. flex-shrink: 0;
  137. "></view>
  138. <view style="
  139. width: 50px;
  140. height: 50px;
  141. background-color: green;
  142. flex-shrink: 0;
  143. "></view>
  144. <view style="
  145. width: 50px;
  146. height: 50px;
  147. background-color: blue;
  148. flex-shrink: 0;
  149. "></view>
  150. <view style="
  151. width: 50px;
  152. height: 50px;
  153. background-color: red;
  154. flex-shrink: 0;
  155. "></view>
  156. <view style="
  157. width: 50px;
  158. height: 50px;
  159. background-color: green;
  160. flex-shrink: 0;
  161. "></view>
  162. <view style="
  163. width: 50px;
  164. height: 50px;
  165. background-color: blue;
  166. flex-shrink: 0;
  167. "></view>
  168. </view>
  169. </view>
  170. </view>
  171. <!-- #ifdef APP -->
  172. </scroll-view>
  173. <!-- #endif -->
  174. </template>
  175. <style>
  176. .common {
  177. width: 250px;
  178. height: 250px;
  179. background-color: gray;
  180. }
  181. </style>