如何获取所选行的列值

How to get column value of selected row

我有 bootstrap table 列 idnamedescriptionauthordate

像这样:<b-table dark bordered striped hover responsive :fields="fields" :items="items" @row-clicked="$router.push({path: 'edit_category'})"></b-table>

所以我想获取所选行的 id 列值并将其放在 @row-clicked="$router.push({path: 'edit_category', query:{id: 此处 })"

您可以这样做:

<b-table :fields="fields" 
         :items="items" 
         @row-clicked="$router.push({path: 'edit_category',query:{id:$event.id}})"
></b-table>