implemented deletion
This commit is contained in:
parent
394bf9ee83
commit
3412049f3a
4 changed files with 12 additions and 4 deletions
|
@ -6,7 +6,7 @@
|
|||
:columns="['cid', 'name']"
|
||||
:actions="[
|
||||
{name:'enlarge'},
|
||||
{name:'content', fun: (item,action) => showBoxContent(item.name)},
|
||||
{name:'content', fun: item => showBoxContent(item.name)},
|
||||
{name:'delete'},
|
||||
]"
|
||||
:items="loadedBoxes"
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
:columns="['uid', 'description', 'box']"
|
||||
:actions="[
|
||||
{name: 'enlarge'},
|
||||
{name: 'delete'}
|
||||
{name: 'delete',fun: item => deleteItem(item)}
|
||||
]"
|
||||
:items="loadedItems"
|
||||
:keyName="'uid'"
|
||||
|
@ -54,7 +54,7 @@ import Table from '@/components/Table';
|
|||
import Cards from '@/components/Cards';
|
||||
import Modal from '@/components/Modal';
|
||||
import EditItem from '@/components/EditItem';
|
||||
import { mapState } from 'vuex';
|
||||
import {mapActions, mapState} from 'vuex';
|
||||
import config from '../config';
|
||||
|
||||
export default {
|
||||
|
@ -66,6 +66,7 @@ export default {
|
|||
components: { Table, Cards, Modal, EditItem },
|
||||
computed: mapState(['loadedItems', 'layout']),
|
||||
methods: {
|
||||
...mapActions(['deleteItem']),
|
||||
openModalWith(item) { // Opens the editing modal with a copy of the selected item.
|
||||
this.selectedItem = { ...item };
|
||||
},
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue