el-table中,后端返回0或1,渲染页面

<el-table-column align="center" label="在离场状态" width="100" prop="entryExitType">
   <template slot-scope="scope">
     {{ scope.row.entryExitType === '1' ? '在场' : '' }}
     {{ scope.row.entryExitType === '0' ? '离场' : '' }}
   </template>
 </el-table-column>

在有v-for的时候,可以在data中定义一个数组。

<div class="item" v-for="v in list" :key="v.backlogId">
	<uni-card @click="toDetails(v.type, v.backlogId, v.state)">
		<view slot="title" class="header">
			<view>{{listInfo[v.type].type}}</view>
			<u-tag :text="state[v.state]" type="success" mode="dark" :closeable="false" size="mini" />
		</view>
	</uni-card>
</div>
<script>
	export default {
		data() {
			return {
				state: ['已读', '未读'],
				listInfo: {
					'0': {type: '班组事项', workerPath: 'details/workerBacklog', teamPath: 'details/teamBacklog'},
					'1': {type: '薪资事项'},
					'2': {type: '记工记量'},
					'4': {type:'更换班组长', workerPath: 'details/workerBacklog'},
					'5': {type: '项目邀请', teamPath: 'details/proBacklog'}
				},
			}
		},
		methods: {
			srolltolower() {
				
			},
			toDetails(type, backlogId, state) {				
				const app = getApp();
				if(app.globalData.isWorker) {
					uni.navigateTo({
						url: this.listInfo[type].workerPath+`?backlogId=${backlogId}&state=${state}&type=${type}`
					})
				} else if(app.globalData.isTeam) {
					uni.navigateTo({
						url: this.listInfo[type].teamPath+`?backlogId=${backlogId}&state=${state}`
					})
				}
				this.queryParam.backlogId = backlogId
				this.handleRead()				
			},
		}
	}
</script>
  • 0
    点赞
  • 2
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值