align-items.uvue 2.0 KB
Newer Older
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
1
<template>
DCloud-WZF's avatar
DCloud-WZF 已提交
2 3 4 5 6 7 8 9
  <!-- #ifdef APP -->
  <scroll-view style="flex: 1">
    <!-- #endif -->
    <view style="flex-grow: 1">
      <view>
        <text>align-items: center</text>
        <view class="common" style="align-items: center">
          <view
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
10
            style="width: 50px; height: 50px; background-color: red"
DCloud-WZF's avatar
DCloud-WZF 已提交
11 12
          ></view>
          <view
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
13
            style="width: 50px; height: 50px; background-color: green"
DCloud-WZF's avatar
DCloud-WZF 已提交
14 15
          ></view>
          <view
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
16
            style="width: 50px; height: 50px; background-color: blue"
DCloud-WZF's avatar
DCloud-WZF 已提交
17 18 19
          ></view>
        </view>
      </view>
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
20

DCloud-WZF's avatar
DCloud-WZF 已提交
21 22 23 24
      <view>
        <text>align-items: flex-start</text>
        <view class="common" style="align-items: flex-start">
          <view
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
25
            style="width: 50px; height: 50px; background-color: red"
DCloud-WZF's avatar
DCloud-WZF 已提交
26 27
          ></view>
          <view
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
28
            style="width: 50px; height: 50px; background-color: green"
DCloud-WZF's avatar
DCloud-WZF 已提交
29 30
          ></view>
          <view
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
31
            style="width: 50px; height: 50px; background-color: blue"
DCloud-WZF's avatar
DCloud-WZF 已提交
32 33 34
          ></view>
        </view>
      </view>
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
35

DCloud-WZF's avatar
DCloud-WZF 已提交
36 37 38 39
      <view>
        <text>align-items: flex-end</text>
        <view class="common" style="align-items: flex-end">
          <view
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
40
            style="width: 50px; height: 50px; background-color: red"
DCloud-WZF's avatar
DCloud-WZF 已提交
41 42
          ></view>
          <view
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
43
            style="width: 50px; height: 50px; background-color: green"
DCloud-WZF's avatar
DCloud-WZF 已提交
44 45
          ></view>
          <view
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
46
            style="width: 50px; height: 50px; background-color: blue"
DCloud-WZF's avatar
DCloud-WZF 已提交
47 48 49
          ></view>
        </view>
      </view>
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
50

DCloud-WZF's avatar
DCloud-WZF 已提交
51 52 53
      <view>
        <text>align-items: stretch</text>
        <view class="common" style="align-items: stretch">
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
54 55 56
          <view style="width: 50px; background-color: red"></view>
          <view style="width: 50px; background-color: green"></view>
          <view style="width: 50px; background-color: blue"></view>
DCloud-WZF's avatar
DCloud-WZF 已提交
57 58 59 60 61 62
        </view>
      </view>
    </view>
    <!-- #ifdef APP -->
  </scroll-view>
  <!-- #endif -->
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
63 64 65
</template>

<style>
DCloud-WZF's avatar
DCloud-WZF 已提交
66
.common {
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
67 68
  width: 250px;
  height: 250px;
DCloud-WZF's avatar
DCloud-WZF 已提交
69 70 71 72
  background-color: gray;
  flex-direction: row;
}
</style>