a***@163.com
a***@163.com
  • 发布:2020-08-04 17:30
  • 更新:2020-08-11 19:59
  • 阅读:478

【报Bug】UNI APP nvue Map组件maker参数从外部获取导入不生效

分类:uni-app

产品分类: uniapp/App

PC开发环境操作系统: Mac

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

HBuilderX类型: 正式

HBuilderX版本号: 2.8.3

手机系统: Android

手机系统版本号: Android 7.1.1

手机厂商: 小米

手机机型: 9

页面类型: nvue

打包方式: 云端

项目创建方式: HBuilderX

操作步骤:
Amap.markers(startPoi, endPoi, "", function(res) {  
                    console.log('点数据', res)  
                    var tmpMarkers = res  
                    that.markers = res  
                })

预期结果:

nuve页面中应该会获得用外部数据返回的值

实际结果:

nvue页面中map组件无小广阔

bug描述:

Amap.markers(startPoi, endPoi, "", function(res) {  
                    console.log('点数据', res)  
                    var tmpMarkers = res  
                    that.markers = res  
                })

其中res返回数据为
···
[{
"iconPath": "/static/map/startPoi.png",
"id": 0,
"longitude": "111.95046",
"latitude": "21.88415",
"width": 23,
"height": 33
}, {
"iconPath": "/static/map/endPoi.png",
"id": 1,
"longitude": "111.94995472235",
"latitude": "21.902531198056",
"width": 23,
"height": 33
}, {
"iconPath": "/static/map/tjd.png",
"id": 0,
"longitude": null,
"latitude": null,
"width": 23,
"height": 33
}]
···

符合markers中所需,但从外部返回数据不生效,如果单独将数据写死可以生效如

Amap.markers(startPoi, endPoi, "", function(res) {  
                    console.log('点数据', res)  
                    var tmpMarkers = res  
                    that.markers = [{  
    "iconPath": "/static/map/startPoi.png",  
    "id": 0,  
    "longitude": "111.95046",  
    "latitude": "21.88415",  
    "width": 23,  
    "height": 33  
}, {  
    "iconPath": "/static/map/endPoi.png",  
    "id": 1,  
    "longitude": "111.94995472235",  
    "latitude": "21.902531198056",  
    "width": 23,  
    "height": 33  
}, {  
    "iconPath": "/static/map/tjd.png",  
    "id": 0,  
    "longitude": null,  
    "latitude": null,  
    "width": 23,  
    "height": 33  
}]  
                })

也尝试过在创建方法直接用this,任然不生效

2020-08-04 17:30 负责人:无 分享
已邀请:
a***@163.com

a***@163.com (作者) - IT理工男

有人吗?

DCloud_uniAD_HDX

DCloud_uniAD_HDX

该问题目前已经被锁定, 无法添加新回复