<view v-for="(list,index) in lists" :key="index">
<text class="m_icon " :class="list.ref == 0 ? 'bg' : 'bg1'">{{list.icon}}</text>
或者
<text class="m_icon bg" v-if="list.ref == '0'">{{list.icon}}</text>
<text class="m_icon bg1" v-if="list.ref == '1'">{{list.icon}}</text>
</view>
<script>
export default {
data() {
return {
lists: [{
logo: '/static/image/user16.png',
company: 'Optobiomed',
icon: 'M',
type: '医疗器械',
num: '单位编号:SHCPCH180402333',
ref: 0
},
{
logo: '/static/image/user17.png',
company: '福進YVESOM',
icon: 'B',
type: '检测分类',
num: '单位编号:SHCPCH180402333',
ref: 1
}
],
}
},
methods: {
}
}
</script>