<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>