字節(jié)跳動小程序開發(fā)組件文檔 view

2019-08-07 10:37 更新

視圖容器,類似DIV。

屬性名 類型 默認值 說明 最低版本
hover-class String none 指定按下去的樣式類。當 hover-class="none" 時,沒有點擊態(tài)效果 1.0.0
hover-start-time Number 50 按住后多久出現(xiàn)點擊態(tài),單位毫秒 1.0.0
hover-stay-time Number 400 手指松開后點擊態(tài)保留時間,單位毫秒 1.0.0
hover-stop-propagation Boolean false 指定是否阻止本節(jié)點的祖先節(jié)點出現(xiàn)點擊態(tài) 1.0.0

示例


開發(fā)者工具中預(yù)覽

<view class="page-section-title">
  <text>flex-direction: row\n橫向布局</text>
</view>
  <view class="page-section-spacing">
    <view class="flex-wrp" style="flex-direction:row;">
      <view hover-class="hover" class="flex-item demo-text-1"></view>
      <view hover-class="hover" class="flex-item demo-text-2"></view>
      <view hover-class="hover" class="flex-item demo-text-3"></view>
    </view>
  </view>
</view>
<view class="page-section">
  <view class="page-section-title">
    <text>flex-direction: column\n縱向布局</text>
  </view>
  <view class="flex-wrp" style="flex-direction:column;">
    <view class="flex-item flex-item-V demo-text-1"></view>
    <view class="flex-item flex-item-V demo-text-2"></view>
    <view class="flex-item flex-item-V demo-text-3"></view>
  </view>
</view>
.flex-wrp{
  margin-top: 60rpx;
  display:flex;
}
.flex-item{
  width: 200rpx;
  height: 300rpx;
  font-size: 26rpx;
}
.flex-item.hover {
    background: green;
}
.flex-item-V{
  margin: 0 auto;
  width: 300rpx;
  height: 200rpx;
}

加了hover-class屬性后的效果:


以上內(nèi)容是否對您有幫助:
在線筆記
App下載
App下載

掃描二維碼

下載編程獅App

公眾號
微信公眾號

編程獅公眾號