swift小程序基础微信小程序

小程序-view

2018-05-30  本文已影响105人  Mccc_

视图容器view的属性说明

view的flex布局

  <view hover-class='hover_red'> 

  .hover_red {
    color: white;
    background-color: yellow;
  }

代码部分

//wxml
<view> 
<view class='row-container'>
  <view class='one' hover-class="hover" hover-stop-propagation="true" hover-start-time="1000" hover-stay-time='3000'>1</view>
  <view class='two'>2</view>
  <view class='three'>3</view>
</view>

<view class='column-container'>
  <view class='one'>1</view>
  <view class='two'>2</view>
  <view class='three'>3</view>
</view>
</view>
// wxss
.row-container {
  display: flex;
  flex-direction: row;
  width: 100%;
  background-color: orange;
}

.column-container {
  display: flex;
  flex-direction: column;
  margin-top: 80rpx;
}

.one {
  width: 200rpx;
  height: 200rpx;
  background-color: red;
font-size: 20px;
}

.two {
  width: 200rpx;
  height: 200rpx;
  background-color: green;
  font-size: 20px;
}

.three {
  width: 200rpx;
  height: 200rpx;
  background-color: blue;
  font-size: 20px;
}

.hover_red {
  color: white;
  background-color: yellow;
}
上一篇 下一篇

猜你喜欢

热点阅读