{
title: '电池外观是否无破损',
dataIndex: 'result1',
key: 'result1',
width: 110,
customRender: function ({ text, record, index }) {
// console.log(text, record, index, 'jjjajja');
if (index === 0) {
if (text === 0) {
console.log(text, record, index, 'jjjajja1');
return <span style={{ color: '#44CB7C' }}>正常</span>
} else if (text === 1) {
return <span style={{ color: '#F5222D' }}>异常</span>
}
} else {
if (index === 1) {
if (text) {
return <a-image width={200} src={text} />
} else {
return <img src={text} alt='暂无图片' />
}
}
}
}
},
vue3+ant-design-vue 中customRender使用
最新推荐文章于 2024-07-03 20:20:28 发布