我希望能够添加按钮到每一行,而不是选择一行和点击按钮:

image.png

2020-10-19 20:27创建
共1个回答
EC
游客ecqXMk

你需要自定义row模板: https://xaksis.github.io/vue-good-table/guide/advanced/#custom-row-template

<template slot="table-row" slot-scope="props">
    <span v-if="props.column.field == 'action'">
      <button class="myButton" @click="doSomething(props.row)"></button>
    </span>
    <span v-else>
      {{props.formattedRow[props.column.field]}}
    </span>
  </template>