有的时候我们需要在img标签中动态绑定数据
//例子用的是uniapp,UI框架是uView<template><view v-for="(item, index) in awardsIconList" :key="index"><u-image width="200rpx" :src="item.value" mode='widthFix'></u-image></view></template><script>export default {data() {return {awardsIconList: [],}},onLoad() {this.getIcon();},method:{getIcon(){const list = new Array();list.push({id: i,value: require('@/static/images/icon/nan.png')});list.push({id: i,value: require('@/static/images/icon/nv.png')});list.push({id: i,value: require('@/static/images/icon/shehuituanti.png')});this.awardsIconList = list;}}}<script>