1👍
Is there a way I can use the package but just get the row data without having it wrapped in another "row"
Yes and no. Slot props (anything the component shares with it’s slot) is always shared as a singe object. You are the one who gives the variable the name.
So in case of slot="columnZ" slot-scope="row"
(which is by the way a deprecated syntax – current syntax is v-slot:columnZ="row"
)
- You can chose any other name – instead of
row
it can beprops
or anything else - what you get is whole object –
{ row: { keyA: value, keyB: value, etc }, index: 1 }
(assuming)
But you can destructure the object into components – v-slot:columnZ="{ row, index }"
This is same operation as in plain JS:
const obj = { row: { keyA: 1, keyB: "asdasd", }, index: 1 }
// here the names `row` and `index` are given by the names of 1st level properties
const { row, index } = obj
console.log(row)
console.log(index)
// it is possible to "rename" te variable
const { row: user } = obj
console.log(user)
As for the missing zero-based index – if this is what the component shares with the slot, there is very little you can do about it. The component is in control. If you really need it, just add one more key into every row containing zero-based index