scinote-web/app/javascript/vue/shared/datatable/mixins/card_selector.js
2023-12-11 09:26:13 +01:00

14 lines
377 B
JavaScript

export default {
methods: {
itemSelected() {
const item = this.dtComponent.selectedRows.find((i) => (i.id === this.params.id));
if (item) {
this.dtComponent.selectedRows = this.dtComponent.selectedRows
.filter((i) => (i.id !== this.params.id));
} else {
this.dtComponent.selectedRows.push(this.params);
}
},
},
};