migrate to vue 3

This commit is contained in:
j3d1 2024-06-18 20:10:10 +02:00
parent bb07a6b641
commit bb71c44aa7
16 changed files with 318 additions and 432 deletions

View file

@ -15,6 +15,7 @@
<script>
import Modal from '@/components/Modal';
import EditItem from '@/components/EditItem';
import {mapActions, mapState} from "vuex";
export default {
name: 'AddItemModal',
@ -23,12 +24,16 @@ export default {
data: () => ({
item: {}
}),
computed: {
...mapState(['lastUsed'])
},
created() {
this.item = {box: this.$store.state.lastUsed.box || '', cid: this.$store.state.lastUsed.cid || ''};
this.item = {box: this.lastUsed.box || '', cid: this.lastUsed.cid || ''};
},
methods: {
...mapActions(['postItem']),
saveNewItem() {
this.$store.dispatch('postItem', this.item).then(() => {
this.postItem(this.item).then(() => {
this.$emit('close');
});
}