Initial commit
This commit is contained in:
26
app/components/handover/HandoverCheckbox.vue
Normal file
26
app/components/handover/HandoverCheckbox.vue
Normal file
@@ -0,0 +1,26 @@
|
||||
<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>
|
||||
Reference in New Issue
Block a user