committed by
Julius Härtl
parent
f51d0b6716
commit
ec01ab4f42
43
src/store/label.js
Normal file
43
src/store/label.js
Normal 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)
|
||||
},
|
||||
}
|
||||
}
|
||||
@@ -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: {
|
||||
|
||||
Reference in New Issue
Block a user