Cover view
Updated at:
The cover-view and cover-image components render text and images on top of native components in Mini Programs.
cover-view
A text view overlaid on native components such as map. Nesting is supported in Mini Program base library 1.10.0 and later.
|
Attribute |
Type |
Default value |
Description |
Minimum version |
|
onTap |
EventHandle |
- |
Tapping event callback. |
cover-image
An image view overlaid on native components. Supports the same overlay targets as cover-view. Nesting is supported in Mini Program base library 1.10.0 and later.
|
Attribute |
Type |
Default value |
Description |
Minimum version |
|
src |
String |
- |
The image URL. Supports the same formats as the image component. |
|
|
onTap |
EventHandle |
- |
Tapping event callback. |
Code sample
<view class="page">
<view class="page-description">cover-view</view>
<view class="page-section">
<view class="page-section-demo" style="position: relative;">
<map
longitude="{{longitude}}"
latitude="{{latitude}}"
scale="{{scale}}"
style="width: 100%; height: 200px;"
include-points="{{includePoints}}"
/>
<cover-view class="cover-view">
<cover-view class="cover-view-item cover-view-item-1"></cover-view>
<cover-view class="cover-view-item cover-view-item-2"></cover-view>
<cover-view class="cover-view-item cover-view-item-3"></cover-view>
</cover-view>
<cover-image style="" src="/image/ant.png" />
</view>
</view>
</view>
Is this page helpful?