How to get selected rows' index in Table element in iview vue? For example, table element is like below:
<Table ref="selection" :columns="columns4" :data="data1" @on-selection-change="updateSelectedNumber"></Table>
How to get selected rows' index in Table element in iview vue? For example, table element is like below:
<Table ref="selection" :columns="columns4" :data="data1" @on-selection-change="updateSelectedNumber"></Table>
On
In your HTML template as
<Table :columns="myColumns" :data="myData" />
do nothing.
In your <script>, when you click on a row, you can get a params object to your function, with data structure like this:
{
row : {...}
index : 0 // or maybe the actual row index,
column: {...}
}
rowClicked(params.index) {
let rowIndex = params.index;
}
GET data rows item clicked. To get the index of the item clicked, simply click on the line you want, not above the checkbox, over the item that is not the box, but that is on the same line.
add this tag
When you select an item, according to the documentation it throws the value of the selected items out. GET data item select
DELETE ITEM EXAMPLE: add the this tag TABLE