Procházet zdrojové kódy

Add getter to index.js for categories without all

sbkwgh před 8 roky
rodič
revize
c319a445e6
1 změnil soubory, kde provedl 12 přidání a 0 odebrání
  1. 12 0
      src/store/index.js

+ 12 - 0
src/store/index.js

@@ -43,6 +43,18 @@ export default new Vuex.Store({
 			}
 		}
 	},
+	getters: {
+		categoriesWithoutAll (state) {
+			var categories = state.meta.categories;
+			categories.shift();
+			categories.unshift({
+				name: 'Select a category',
+				disabled: true
+			});
+
+			return categories;
+		}
+	},
 	mutations: {
 		setTab (state, payload) {
 			state.tabs[payload.tab] = payload.index;