小程序 cover-view 使用

  • 覆蓋在原生組件之上的文本視圖。

  • 可覆蓋的原生組件包括 map、video、canvas、camera、live-player、live-pusher

  • 只支持嵌套 cover-view、cover-image,可在 cover-view 中使用 button。組件屬性的長度單位默認爲px,2.4.0起支持傳入單位(rpx/px)。

個人示例

<map class="map" id="map" longitude="{{longitude}}" latitude="{{latitude}}" scale="16" markers="{{markers}}" bindmarkertap="makertap" bindregionchange="mapchangeTap" >
    <cover-view class="tips-dialog">
      <cover-image src="/assets/img/[email protected]" class="tips-dialog-img"></cover-image>
      <cover-view wx:if="{{xb_count}}" class="tips-dialog-txt">
        <cover-view class="xb">附近有{{xb_count}}位小幫</cover-view>
        <cover-view class="minute">
          <cover-view>預計最快</cover-view>
          <cover-view style="color:#FF6600;">{{min_time_text}}</cover-view>
          <cover-view>內到達</cover-view>
        </cover-view>
      </cover-view>
      <cover-view wx:else class="tips-dialog-txt2">附近暫無小幫</cover-view>
    </cover-view>
   <cover-image class="map-img" src="/assets/img/[email protected]"/> 
  </map>

官方示例

<map
        style="width: 100%; height: 300px;"
        latitude="{{latitude}}"
        longitude="{{longitude}}"
      >
        <cover-view class="cover-view">
          <cover-view class="container">
            <cover-view class="flex-wrp" style="flex-direction:row;">
              <cover-view class="flex-item demo-text-1"></cover-view>
              <cover-view class="flex-item demo-text-2"></cover-view>
              <cover-view class="flex-item demo-text-3"></cover-view>
            </cover-view>
          </cover-view>
        </cover-view>
      </map>
發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章