<template slot-scope="scope"> <el-button :type="`${scope.row.triggerCode==500?'danger':'' || scope.row.triggerCode === 200?'success':''}`">{{ statusList.find(t => t.value ===scope.row.triggerCode).label }}</el-button></template> export default { name: 'xxxx', components: {}, data() { return { statusList: [ { value: 500, label: '失败' }, { value: 502, label: '失败(超时)' }, { value: 200, label: '成功' }, { value: 0, label: '无' } ] } } created() { this.fetchData() } }