vue2.0 循环遍历加载不同图片的方法
作者:yyjourney 时间:2024-05-08 10:24:50
demo:
<div v-for="item in temps" :key="item.id">
<div class="contract-item">
<img :src="item.imgUrl">
</div>
</div>
引入图片,注意路径:
import con1 from "@/assets/img/con01.png";
import con2 from "@/assets/img/con02.png";
import con3 from "@/assets/img/con03.png";
进行图片的加载位置:
temps: [
{
imgUrl: con1
},
{
imgUrl: con2
},
{
imgUrl: con3
},
],
这样就实现了循环遍历的时候加载不同的图片。
来源:http://blog.csdn.net/yyjourney/article/details/78971074
标签:加载,图片,vue2.0,循环,遍历
![](/images/zang.png)
![](/images/jiucuo.png)
猜你喜欢
python实现求解列表中元素的排列和组合问题
2022-03-18 00:05:08
CSS处理斜角导航条的一个例子
2007-08-27 12:38:00
![](https://img.aspxhome.com/file/UploadPic/20078/27/2007827125535125s.gif)
python实现的分层随机抽样案例
2022-06-07 16:10:42
![](https://img.aspxhome.com/file/2023/8/115878_0s.jpg)
Idea 2019.3 本应该搜索到的插件却搜索不到的解决方法
2022-03-18 14:42:22
![](https://img.aspxhome.com/file/2023/0/132340_0s.jpg)
Python利用第三方模块实现压缩css文件
2023-04-28 07:21:02
![](https://img.aspxhome.com/file/2023/6/110536_0s.png)
python创建与遍历List二维列表的方法
2023-04-29 13:07:48
细化解析:SQL Server 2005 数据库镜像
2009-01-23 13:41:00
30个提高Web程序执行效率的好经验分享
2023-07-16 00:14:22
TXT.WORD文档下载另存为,而不是在浏览器中打开
2007-10-25 11:43:00
如何做一个文本书写器?
2010-07-12 18:58:00
新手入门:防范SQL注入攻击的新办法
2009-03-11 15:14:00
Win10下Python环境搭建与配置教程
2023-08-24 03:25:18
![](https://img.aspxhome.com/file/2023/3/61453_0s.png)
静态页面利用JS读取cookies记住用户信息
2011-04-14 11:17:00
Oracle11g完全卸载的详细步骤(超管用)
2024-01-25 17:04:43
python编程实现清理微信重复缓存文件
2022-06-20 02:12:12
![](https://img.aspxhome.com/file/2023/7/68417_0s.png)
在MySQL中使用Sphinx实现多线程搜索的方法
2024-01-22 17:25:45
MySQL数据库之字符集 character
2024-01-22 04:42:13
python中的随机数 Random介绍
2022-05-08 09:49:03
Yii框架登录流程分析
2024-05-11 09:19:43
Python中可变和不可变对象的深入讲解
2022-12-29 21:31:21
![](https://img.aspxhome.com/file/2023/5/87635_0s.png)