소스 검색

Add getter to index.js for categories without all

sbkwgh 8 년 전
부모
커밋
c319a445e6
1개의 변경된 파일12개의 추가작업 그리고 0개의 파일을 삭제
  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;