在js中写image thisbaseURL + apifileImagesystemfileicon-1png 图片位置正确、图片文件正常是否是在js中图片不能这样写若是在JavaScript中data的return返回的数组中如何引用服务器地址的网络图片例如:workStateList image staticteamLeadericon-1png imagethisb
在JavaScript中引用服务器地址的网络图片,可以使用如下方式:
image: `${this.baseURL}/api/file/Image/systemfile/icon-1.png`
或者:
image: this.baseURL + '/api/file/Image/systemfile/icon-1.png'
注意在第二种方式中要将引号放在整个URL的外面。同时,如果在返回的数组中使用第二种方式,可以直接使用this关键字引用baseURL。例如:
image: this.baseURL + '/api/file/Image/systemfile/icon-2.png'
原文地址: https://www.cveoy.top/t/topic/b6bx 著作权归作者所有。请勿转载和采集!