scinote-web/app/javascript/vue/shared/datatable/mixins/card_selector.js

15 lines
377 B
JavaScript
Raw Normal View History

2023-12-01 07:01:08 +08:00
export default {
methods: {
itemSelected() {
2023-12-11 16:18:22 +08:00
const item = this.dtComponent.selectedRows.find((i) => (i.id === this.params.id));
2023-12-01 07:01:08 +08:00
if (item) {
2023-12-11 16:18:22 +08:00
this.dtComponent.selectedRows = this.dtComponent.selectedRows
.filter((i) => (i.id !== this.params.id));
2023-12-01 07:01:08 +08:00
} else {
this.dtComponent.selectedRows.push(this.params);
}
2023-12-11 16:18:22 +08:00
},
},
};