学习
实践
活动
专区
工具
TVP
写文章

请问elementUI中formatter是否能传额外的参数?

  • 回答 (2)
  • 关注 (0)
  • 查看 (3944)

在elementUI的官方文档中table的formatter接收四个参数

Function(row, column, cellValue, index)

请问能否在其中传入自定义参数的同时不影响formatter的默认传参

用户2094452用户2094452提问于
用户2094452邀请了cookie来回答
用户1174737回答于

:formatter="(row, column) => A(row, column, xxx)"

xxx就是你能添加的参数

用户7872613回答于

<el-table-column label="缴费金额" :formatter="formatPrice(props.row.price)"></el-table-column>

formatPrice(price){

return () => {

return price;

};

}

扫码关注腾讯云开发者

领取腾讯云代金券