cover-view无法通过v-if去控制显示隐藏
问题描述
可以控制显示,但是隐藏不了,查了好多资料,都无法实现,官方也没有方案,废话不多说,直接上代码
问题解决后能否点个关注点个赞!!!
说明你代码规范不好,没有严格按照官方要求去写
把你的cover-view等标签全部放到map标签里面就可以了,不管是cover-view还是cover-image都一样
<template>
<view style="width: 100%;">
<map ref="maps" id="maps" class="map" style="width:100vw;height:calc(100vh - 87px);" :markers="covers"
:polyline="polylineOption" :latitude="latitude" :longitude="longitude" :scale="18" enable-rotate
show-compass :enable-3D="true" enable-poi enable-building enable-indoorMap @regionchange="onRegionChange"
@updated="updated">
<cover-view v-if="isEndInspections"
style="width:60vw;height:60vh;background:#fff;position: absolute;top:50%;left:50%;transform: translateX(-50%) translateY(-50%);">
<cover-view class="flex flex-between flex-align-center" style="height:50px;">
<cover-view class="margin-left-lg">
结束巡检
</cover-view>
<cover-view class="margin-right-lg">
关闭
</cover-view>
</cover-view>
<cover-view style="height:calc(100% - 110px);background:#f0f3" class="margin-left-lg margin-right-lg">
提示内容
</cover-view>
<cover-view style="position: absolute;bottom: 0px;width:60vw;height:60px;background-color: #0003;"
class="flex flex-center flex-align-center">
<cover-view @click="close">
确定结束
</cover-view>
<cover-view>
问题上报
</cover-view>
</cover-view>
</cover-view>
</map>
</view>
</template>