flex-shrink.uvue 757 字节
Newer Older
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
1
<template>
DCloud-WZF's avatar
DCloud-WZF 已提交
2 3 4 5 6
  <view style="flex-grow: 1">
    <view>
      <text>flex-shrink</text>
      <view
        style="
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
7 8
          width: 250px;
          height: 150px;
DCloud-WZF's avatar
DCloud-WZF 已提交
9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24
          background-color: gray;
          flex-direction: row;
        "
      >
        <view class="common" style="background-color: red; flex-shrink: 1">
          <text>1</text>
        </view>
        <view class="common" style="background-color: green; flex-shrink: 2">
          <text>2</text>
        </view>
        <view class="common" style="background-color: blue; flex-shrink: 3">
          <text>3</text>
        </view>
      </view>
    </view>
  </view>
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
25 26 27
</template>

<style>
DCloud-WZF's avatar
DCloud-WZF 已提交
28
.common {
DCloud-yinjiacheng's avatar
DCloud-yinjiacheng 已提交
29 30
  width: 125px;
  height: 50px;
DCloud-WZF's avatar
DCloud-WZF 已提交
31 32 33 34
  justify-content: center;
  align-items: center;
}
</style>