uniapp map关于地图显示iconPath的问题
文章目录
在开发过程中,map中的iconPath是可以展示
准备在手机上查看的时候,发现图片是这样的
发现问题就得解决!!!
经过一系列操作之后,终于解决了这个问题.
let img = ''
switch (this.chooseType){
case 'company':
img = require('../../../static/img/icon-map-company.png')
break;
case 'build':
img = require('../../../static/img/icon-map-build.png')
break;
case 4:
img = require('../../../static/img/icon-map-land.png')
break;
}
return img
上面是手机无法正常显示的代码
so下面就是解决办法
let img = ''
switch (this.chooseType){
case 'company':
img = '/static/img/icon-map-company.png'
break;
case 'build':
img = '/static/img/icon-map-build.png'
break;
case 4:
img = '/static/img/icon-map-land.png'
break;
}
return img
没想到吧,就是这么简单粗暴!
评论
登录后参与技术讨论,分享你的经验与见解。
登录 / 注册暂无评论