c3lf-system-3/web/src/components/AddBoxModal.vue
2024-01-07 21:54:54 +01:00

36 lines
No EOL
930 B
Vue

<template>
<div>
<Modal v-if="isModal" title="Add Box" @close="$emit('close')">
<template #body>
<div>
<input type="text" class="form-control" placeholder="Box Name" v-model="box_name">
</div>
</template>
<template #buttons>
<button type="button" class="btn btn-secondary" @click="$emit('close')">Cancel</button>
<button type="button" class="btn btn-success" @click="createBox({name: box_name})">Create</button>
</template>
</Modal>
</div>
</template>
<script>
import Modal from '@/components/Modal';
import {mapActions} from "vuex";
export default {
name: 'AddBoxModal',
components: {Modal},
props: ['isModal'],
data: () => ({
box_name: '',
}),
methods: {
...mapActions(['createBox']),
},
};
</script>
<style scoped>
</style>