背景:

参考 fusion protable , 将操作列直接耦合 button 组件,因为 col.render 函数能拿到 行数据record,那么 pro-table 组件封装的时候,就可以在渲染操作列按钮的时候,将 col.render 参数透传给 button 组件

方式2

slot + 扩展参数

image.png

将扩展参数写成:

  1. {
  2. record: this.record,
  3. index: this.index
  4. }

那事件处理函数的第二个参数即可得到:

  1. onClick_new_new(...args){
  2. console.log(args)
  3. }