From dad54ffd2faf717aadb301b6135c5c2cb5609b71 Mon Sep 17 00:00:00 2001 From: tykayn Date: Thu, 21 Jan 2021 12:34:21 +0100 Subject: [PATCH] feat(store): complete store data --- components/SearchInput.vue | 4 ++-- store/index.ts | 19 +++++++++++++++---- 2 files changed, 17 insertions(+), 6 deletions(-) diff --git a/components/SearchInput.vue b/components/SearchInput.vue index fbe2bad..6197cc7 100644 --- a/components/SearchInput.vue +++ b/components/SearchInput.vue @@ -17,7 +17,7 @@
( ici une carte ) - + logo osm

Sélection:

diff --git a/store/index.ts b/store/index.ts index 3d2260e..893d863 100644 --- a/store/index.ts +++ b/store/index.ts @@ -1,7 +1,18 @@ +/** + * see VueX docs + */ export const state = () => ({ counter: 0, + isFetching: false, + searchInput: '', + selectedResult: null, list: [], - formConfig: {}, + formConfig: { + name: '', + delivery: false, + hours: [], + tags: [], + }, }) export const mutations = { @@ -17,10 +28,10 @@ export const mutations = { remove(state: any, { todo }: any) { state.list.splice(state.list.indexOf(todo), 1) }, - toggle(state: any, todo: any) { - todo.done = !todo.done - }, setFormField(state: any, { field }: any) { state.formConfig[state.formConfig.indexOf(field)] = field }, + setTag(state: any, { field }: any) { + state.formConfig.tags[state.formConfig.tags.indexOf(field)] = field + }, }