img标签中的src属性,可填写接口地址记录
jsp中的img标签的src写请求接口
<!-- 缩略图 -->
<div class="mCommon_basicThumbnail clearfix marginTop10">
<c:forEach items="${outputModel.orderReFundFileList}" var="file">
<p class="mCommon_basicThumbnail_img">
<img id="${file.fileID}" src="${ctxPath}/file/loadPrivatePic.img?id=${file.fileID}&category=product&show=middle&x=640&y=640">
</p>
</c:forEach>
</div>
vue中的img标签的src请求接口写法
<div class="imgInfo" v-if="orderRefund.reFundFileList.length>0">
<img class="myOwnImg" :src="`http://10.46.134.94:8088/file/loadPrivatePic.img?id=${item.fileID}&category=product&show=middle&x=640&y=640`" v-for="(item,index) in orderRefund.reFundFileList" :key="index" @click="imgShow=true,startPosition=index">
</div>
第一次碰见这种写法,之前都是src中写图片的地址,看原项目老代码jsp中碰见的,然后在新vue改版项目中也试了一下,发现可行,但是这里需要注意下vue中的IP域名是不是死的,要用的话需要注意改成动态的,我没有深入研究;同时这个接口的response没有返回值,他是直接添加到location里的,如下图