view

View container Equivalent with the div of web or the view of react-native.

Attribute NameTypeDefaultDescriptionMinimum Version
disable-scrollBooleanfalseForbid scroll page within region
hover-classStringStyle class to be added upon clicking
hover-start-timeNumberstart the clicking status after a period of holding, in millisecond
hover-stay-timeNumberHold the clicking status after release, in millisecond
hiddenbooleanfalsehide or not
classStringcustom style name
styleStringinline style
onTapEventHandleClick
onTouchStartEventHandlestart of touch action
onTouchMoveEventHandlemove after touch
onTouchEndEventHandleend of touch action
onTouchCancelEventHandletouch action interrupted, such as incoming call and pop-up
onLongTapEventHandletrigger on 500ms-duration pressing. After long-press event,  moving does not trigger screen scroll

Note: The animation generated with my.createAnimation is realized via transition and triggers only onTransitionEnd, but does not trigger onAnimationStart, onAnimationIteration or onAnimationEnd.

Sample Code

copy
<view class="post">
  <!-- hidden -->
  <view class="postUser" hidden>
    <view class="postUser__name">Jessie</view>
  </view>
  <!-- hover class -->
  <view class="postBody" hover-class="red">
    <view class="postBody__content">
      Good!
    </view>
    <view class="postBody__date">
      June 1
    </view>
  </view>
</view>