那种事情不要哇
那种事情不要哇
  • 发布:2024-06-17 16:08
  • 更新:2024-06-18 17:19
  • 阅读:44

【报Bug】地图组件在nvue下markers无效

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Windows

PC开发环境操作系统版本号: win10

HBuilderX类型: 正式

HBuilderX版本号: 4.15

手机系统: Android

手机系统版本号: Android 14

手机厂商: vivo

手机机型: iqoo8

页面类型: nvue

vue版本: vue3

打包方式: 云端

项目创建方式: HBuilderX

操作步骤:

markers.value = _arry赋值

预期结果:

显示markers

实际结果:

markers无显示

bug描述:

使用markers.value = _arry赋值之后,微信开发者工具上显示正常,但是手机上调试是出不来的,而且设置markers的宽高也是一样的情况,markers的宽高在真机调试上根本不变,微信开发者工具显示正常。

2024-06-17 16:08 负责人:无 分享
已邀请:
那种事情不要哇

那种事情不要哇 (作者)

再补充两个bug,使用cover-view标签,点击事件不生效,在cover-view上加@click不生效,@markertap事件也不会触发

<map min-scale="14" scale="14" ref="map" id="map" :latitude="myLocation.latitude" :longitude="myLocation.longitude"  
         :markers="markers" @markertap="markertap" :style="'height:'+windowHeight+'px; width:'+windowWidth+'px;'"  
        :polyline="polyline" @regionchange="regionchange" @anchorpointtap='anchorpointtap'>  
        <cover-view slot="callout">  
            <template v-for="(item,index) in markers"  >  
                <cover-view :marker-id="item.id" >  
                    <cover-view style="position: relative;width: 60rpx;height: 60rpx;">  
                        <cover-view style="position: absolute;top: 7rpx;left: 20rpx;color: white;">  
                            <cover-view style="z-index: 999;" @click="markertap(item.id)">{{item.id}}</cover-view>  
                        </cover-view>  
                    </cover-view>  
                </cover-view>  
            </template>  
        </cover-view>  

    </map>
沈工

沈工

解决有尝吗

那种事情不要哇

那种事情不要哇 (作者)

解决了,原因是markers和polyline的赋值需要用ref定义,并且markers和polyline只能使用赋值替换,使用push是不生效的,文档压根不写这个

要回复问题请先登录注册