first try

Signed-off-by: Jakob Röhrl <jakob.roehrl@web.de>
This commit is contained in:
Jakob Röhrl
2019-03-12 10:29:05 +01:00
committed by Julius Härtl
parent f51d0b6716
commit ec01ab4f42
9 changed files with 243 additions and 30 deletions

43
src/store/label.js Normal file
View File

@@ -0,0 +1,43 @@
import Vue from 'vue'
export default {
state: {
labels: []
},
getters: {
labelByCurrentBoard() {
console.log(state)
return state.currentBoard.labels;
},
labelById: state => (id) => {
//return state.cards.find((card) => card.id === id)
}
},
mutations: {
addLabel(state, label) {
},
updateLabel(state, label) {
},
removeLabel(state, id) {
console.log(this.state.labels);
this.state.labels = this.state.labels.filter((l) => {
return id !== l.id
})
console.log(this.state.labels);
},
},
actions: {
removeLabel({ commit }, id) {
commit('removeLabel', id)
},
}
}

View File

@@ -27,6 +27,7 @@ import { boardToMenuItem } from './../helpers/boardToMenuItem'
import { BoardApi } from './../services/BoardApi'
import stack from './stack'
import card from './card'
import label from './label'
Vue.use(Vuex)
@@ -42,7 +43,8 @@ export const BOARD_FILTERS = {
export default new Vuex.Store({
modules: {
stack,
card
card,
label
},
strict: debug,
state: {