javascript - 使用 antd column render 显示另一列的百分比
问题描述
我忽略的另一个可能很简单的问题。在我的专栏中:
{
title: 'Min. Value',
dataIndex: 'min_value',
render: min_value => `${min_value}`,
width: '10',
},
{
title: 'Max Value',
dataIndex: 'max_value',
render: max_value => `${max_value}`,
width: '15',
},
{
title: 'Min. Commission',
dataIndex: 'min_commission',
render: row => {row.min_value},
width: '15',
},
{
title: 'Max Commission',
dataIndex: 'max_commission',
render: max_value => `${max_value}`,
width: '15',
},
我正在尝试使用该render
选项min_commission
并max_commission
显示它们各自的最小值/最大值列的百分比。当前min_commission
显示的只是尝试显示来自min_value
.
这只是给出了错误:
Failed to compile
./src/components/LeaderBoard.js
Line 65:23: Expected an assignment or function call and instead saw an expression no-unused-expressions
Search for the keywords to learn more about each error.
只是试图显示另一列中的数据,我有点卡住了。我觉得这是我在担心添加百分比计算之前需要的第一步,我只是不知道如何提取数据。当前row => {row.min_value}
是基于我发现的另一个几乎类似情况的线程,所以我认为它可能会起作用。
解决方案
推荐阅读
- apache-beam - PubsubIO , msg 超过最大大小,如何执行错误处理
- angular - 角度将管道数组分配给变量
- powershell - 在 Powershell 中将 New-Item cmdlet 与 Literalpath 一起使用?
- php - 向管理员购物车数据发送电子邮件
- mini-xml - mini-XML - 找不到下一个兄弟节点
- python - lmfit ExponentialGaussianModel( ) 的使用
- c++ - 结构中的友元函数有什么用?
- javascript - 如何将分数添加到记分牌?
- java - Java + JavaFX:错误:无法找到或加载主类
- c# - 列表数组在模型列表中没有变化