When vue requires the introduction of a large number of pictures, pictures of how the cycle path introduced

When the project encountered a large number of images need to be introduced, it is necessary to render the circulation path,: src = "" always get to the path as a string processing, the picture can not be displayed.

Pictures should be placed under static, do not put assets.

<ul class="flex">
	<li @click="selectImgGroup(item,index)" v-for="(item,index) in imgData" :key='index'>
	   <img :src="item.src" width="64" alt="">
	</li>
</ul>
const imgData = [
  {src:'../../../static/images/DeviceImage/accelerator.png'},
  {src:'../../../static/images/DeviceImage/access_point.png'},
  {src:'../../../static/images/DeviceImage/accessPoint3Com.png'},
  ...
];
Published 47 original articles · won praise 4 · Views 6673

Guess you like

Origin blog.csdn.net/lifangfang0607/article/details/103449893