在开发过程中,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
没想到吧,就是这么简单粗暴!
**粗体** _斜体_ [链接](http://example.com) `代码` - 列表 > 引用
。你还可以使用@
来通知其他用户。