在data里面 导入路径
topIcon2:require("./assets/img/topIcon2.jpg"),
topIcon3:require("./assets/img/topIcon3.jpg"),
topIcon4:require("./assets/img/topIcon4.jpg"),
topIcon5:require("./assets/img/topIcon5.jpg"),
页面
<img v-if=‘item.id==2‘ v-bind:src="topIcon2" >
<img v-if=‘item.id==3‘ v-bind:src="topIcon3" >
<img v-if=‘item.id==4‘ v-bind:src="topIcon4" >
<img v-if=‘item.id==5‘ v-bind:src="topIcon5" >
原文地址:https://www.cnblogs.com/zhuwu/p/9055245.html
时间: 2024-10-23 11:00:20