对于这种,样式一样,但是图片和字体颜色不一样,动态渲染。
代码:
<template>
<view class="page">
<view class="rows" v-for="item in data">
<view class="v0">
<view class="icon">
<image :src="item.image" class="xyj-icon"></image>
</view>
<view class="title">
<view class="item">{{item.item}}</view>
<view class="time">{{item.time}}</view>
</view>
<view class="status" :style="{ color: item.color }">{{item.status}}</view>
</view>
</view>
</view>
</template>
<script setup>
const data = [
{ id:1 , image:"../../static/icon/xyj-icon.png", item:'TS57421J7Y8Z', time:'2044 - 08 - 30 20:11',status:'已报修',color: '#FD9352'},
{ id:2, image:"../../static/icon/xyj-icon.png", item:'TS57421J7Y8Z', time:'2044 - 08 - 30 20:11',status:'处理中', color: '#738AED' },
{ id:3 , image:"../../static/icon/cfj-icon.png", item:'TS57421J7Y8Z', time:'2044 - 08 - 30 20:11',status:'处理中', color: '#738AED'},
{ id:4, image:"../../static/icon/xyj-icon.png", item:'TS57421J7Y8Z', time:'2044 - 08 - 30 20:11',status:'已解决', color: '#00C0D3 '},
{ id:5 , image:"../../static/icon/cfj-icon.png", item:'TS57421J7Y8Z', time:'2044 - 08 - 30 20:11',status:'已解决', color: '#00C0D3 ' }
];
</script>
看得懂,会写了,下班!