<div
class="rno-lattice-cell disabled"
v-for="(item, index) in 8"
:key="index"
>
<div class="rno-1-logo-case">
<a>
<img
class="J-homeCustomerImg"
:src="getImgUrl(companyLogoList[index], 'jpg')"
/>
</a>
</div>
</div>
companyLogoList: [
'amazon.jpg',
'gaotong.jpg',
'google.jpg',
'hp.jpg',
'IBM.jpg',
'microsoft.jpg',
'nvidia.jpg',
'sanxing.jpg',
'apple.jpg',
],
核心要点:required 引入路径需要拼接 不能直接required(imgpath)
getImgUrl(url, type) {
if (type == 'png') {
const a = require('../../assets/img/index/' + url + '.png')
console.log('a', a)
return a
} else if (type == 'jpg') {
const b = require('../../assets/img/index/' + url)
console.log('b', b)
return b
}
},