Files
hrm/app/components/handover/HandoverCheckbox.vue
2026-04-06 15:53:14 +07:00

26 lines
706 B
Vue

<script setup>
const props = defineProps({
productId: Number,
});
const { $store } = useNuxtApp();
$store.commit('selectedProductsForHandoverEmail', []);
</script>
<template>
<input
type="checkbox"
:checked="$store.selectedProductsForHandoverEmail.includes(props.productId)"
@change="(e) => {
if (e.target.checked) {
$store.commit(
'selectedProductsForHandoverEmail',
[ ...$store.selectedProductsForHandoverEmail, props.productId],
)
} else {
$store.commit(
'selectedProductsForHandoverEmail',
$store.selectedProductsForHandoverEmail.filter(x => x !== props.productId),
)
}
}"
/>
</template>