view

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

Property

TypeDefaultDescription
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>