main-web/src/hooks/useSelection.js

12 lines
272 B
JavaScript
Raw Normal View History

2024-08-20 12:11:33 +00:00
import { ref } from '@vue/composition-api'
export default function () {
const selectionIds = ref([])
function handleSelectionChange(selections) {
2024-08-21 01:17:14 +00:00
selectionIds.value = selections.map(item => item.id)
2024-08-20 12:11:33 +00:00
}
return {
selectionIds,
2024-08-21 01:17:14 +00:00
handleSelectionChange
2024-08-20 12:11:33 +00:00
}
}