Currently, I am referring to this library for checkboxes. As I delve into the code, I notice how it is declared and utilized.
Initially within the el-table
, we have
@selection-change="handleSelectionChange"
. They have initialized an empty array element in the data section like so:
data() {
retrun {
multipleSelection: []
}
},
methods:{
handleSelectionChange(val) {
this.multipleSelection = val;
}
}
I am currently trying to filter out only the records of clicked checkboxes. My method looks something like this -
let data = [];
console.log(this.multipleSelection.length);
if (this.multipleSelection.length == 0) {
data = JSON.parse(JSON.stringify(this.myapidata));
} else {
data = JSON.parse(JSON.stringify(this.multipleSelection));
}
However, despite my efforts, I am still retrieving all the data instead of just the selected ones. If anyone has encountered a similar issue and can provide guidance, please assist.