view
View container Equivalent with the div of web or the view of react-native.
Attribute Name | Type | Default | Description | Minimum Version |
disable-scroll | Boolean | false | Forbid scroll page within region | |
hover-class | String | Style class to be added upon clicking | ||
hover-start-time | Number | start the clicking status after a period of holding, in millisecond | ||
hover-stay-time | Number | Hold the clicking status after release, in millisecond | ||
hidden | boolean | false | hide or not | |
class | String | custom style name | ||
style | String | inline style | ||
onTap | EventHandle | Click | ||
onTouchStart | EventHandle | start of touch action | ||
onTouchMove | EventHandle | move after touch | ||
onTouchEnd | EventHandle | end of touch action | ||
onTouchCancel | EventHandle | touch action interrupted, such as incoming call and pop-up | ||
onLongTap | EventHandle | trigger 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>