From ec14e00ef79edf74c86ba3ebf650c31cf8b6d98b Mon Sep 17 00:00:00 2001 From: ChangJoo Park Date: Mon, 6 Mar 2017 20:44:10 +0900 Subject: [PATCH] =?UTF-8?q?#13=20=EA=B8=B0=EC=A1=B4=20store=20=EC=A0=9C?= =?UTF-8?q?=EA=B1=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/lib/sotre.js | 51 ------------------------------------------------ 1 file changed, 51 deletions(-) delete mode 100644 src/lib/sotre.js diff --git a/src/lib/sotre.js b/src/lib/sotre.js deleted file mode 100644 index 64e2662..0000000 --- a/src/lib/sotre.js +++ /dev/null @@ -1,51 +0,0 @@ -import Vue from 'vue' -import Vuex from 'vuex' - -Vue.use(Vuex) - -const state = { - user: { - name: 'Alexander Pierce', - state: { - color: '#3c763d', - name: 'Online' - } - }, - badges: { - messages: 0, - notifications: 0, - tasks: 0 - } -} - -const mutations = { - UPDATE_BADGE (state, key, value) { - switch (key) { - case 'messages': - case 'notifications': - case 'tasks': - break - default: - return - } - state[key] = value - } -} - -const action = { - updateBadge ({commit}, key, value) { - commit('UPDATE_BADGE', key, value) - } -} - -const getters = { - user: state => state.user, - badges: state => state.badges -} - -export default new Vuex.Store({ - state, - getters, - action, - mutations -})