view

view为视图容器。
小程序开发之组件view(视图容器)

index.wxml

<view class="section">
  <view class="section_title">横向</view>
  <view class="flex-wrp" style="flex-direction:row;">
    <view class="bg_green">1</view>
    <view class="bg_red">2</view>
    <view class="bg_blue">3</view>
  </view>
</view>

<view class="section">
  <view class="section_title">竖向</view>
  <view class="flex-wrp" style="height: 300px;flex-direction:column;">
    <view class="bg_green">1</view>
    <view class="bg_red">2</view>
    <view class="bg_blue">3</view>
  </view>
</view>

index.wxss

.flex-wrp {
  display: flex;
}
.bg_green {
  background: green;
  width:100px; 
  height: 100px;
}
.bg_red {
  background: red;
  width:100px; 
  height: 100px;
}
.bg_blue {
  background: blue;
  width:100px; 
  height: 100px;
}

视图展示

小程序开发之组件view(视图容器)





相关文章:

  • 2021-04-01
  • 2021-10-03
  • 2021-06-25
  • 2021-07-12
  • 2022-01-08
  • 2021-10-13
  • 2021-11-13
  • 2021-12-23
猜你喜欢
  • 2021-05-13
  • 2022-12-23
  • 2021-11-06
  • 2021-07-14
  • 2021-05-25
  • 2021-07-27
  • 2022-01-12
相关资源
相似解决方案