diff --git a/src/store/modules/config.js b/src/store/modules/config.js index d7b4ade..94298db 100644 --- a/src/store/modules/config.js +++ b/src/store/modules/config.js @@ -1,4 +1,5 @@ import { readFile } from 'fs' +import Vue from 'vue' import path from 'path' import yaml from 'js-yaml' @@ -39,6 +40,9 @@ export default { state.tags = Object.keys(tags) .reduce((c, k) => (c[k.toLowerCase()] = tags[k], c), {}) }, + APPEND_TAG: (state, { tag }) => { + Vue.set(state.tags, tag.name.toLowerCase(), tag) + }, SET_CATEGORIES: (state, { categories }) => { state.categories = Object.keys(categories) .reduce((c, k) => (c[k.toLowerCase()] = categories[k], c), {}) @@ -60,7 +64,7 @@ export default { }) }, edit_tag (context, tag) { - console.log(tag) + context.commit('APPEND_TAG', { tag: tag }) } } }