diff --git a/components/SearchInput.vue b/components/SearchInput.vue index 6197cc7..18e3715 100644 --- a/components/SearchInput.vue +++ b/components/SearchInput.vue @@ -17,7 +17,7 @@ -

Tags de data.elements[0]

-
- elements: {{ data.elements.length }} - - - - - - - - - - - - - - - - - - Vente à emporter - - - Parking vélo - - - Accès Internet - - - borne de recharge électrique sur parking - - - Accès autorisé au public - - - -

Horaires d'ouverture

-
- {{ data.elements[0].tags.opening_hours }} -
- - -
-
-
-

Comparaison des tags

- - - - - - - - - - - - - -
API OSMAPI addok
- - - - - - - - - - - -
-
-
- {{ name }} -
-
{{ value }}
-
-
-
-
-
-
+      

Debug info

+
       select.properties:
       {{ select }}
-    
-
-      data:
-      {{ data }}
-    
-
-      osm_data:
-      {{ osm_data }}
-    
+
+
+      fetchedData OSM:
+      {{ fetchedData.osm_data }}
+    
+ diff --git a/components/TagTable.vue b/components/TagTable.vue new file mode 100644 index 0000000..4862171 --- /dev/null +++ b/components/TagTable.vue @@ -0,0 +1,113 @@ + diff --git a/pages/Horaires.vue b/pages/Horaires.vue index 1354505..70d49a5 100644 --- a/pages/Horaires.vue +++ b/pages/Horaires.vue @@ -2,8 +2,31 @@

Horaires

Vos horaires actuelles

+
    +
  • + {{ h }} +
  • +
+ diff --git a/store/example.js b/store/example.js new file mode 100644 index 0000000..0999c4f --- /dev/null +++ b/store/example.js @@ -0,0 +1,18 @@ +export const state = () => ({ + list: [], +}); + +export const mutations = { + add(state, text) { + state.list.push({ + text, + done: false, + }); + }, + remove(state, { todo }) { + state.list.splice(state.list.indexOf(todo), 1); + }, + toggle(state, todo) { + todo.done = !todo.done; + }, +}; diff --git a/store/index.js b/store/index.js new file mode 100644 index 0000000..09bce29 --- /dev/null +++ b/store/index.js @@ -0,0 +1,56 @@ +/** + * see VueX docs + */ +export const state = () => ({ + counter : 0, + isFetching : false, + searchInput : 'librairie interlignes', + selectedResult: null, + fetchedData : { + osm_data : '', + addok_data: '', + }, + list : [], + formConfig : { + name : '', + delivery: false, + hours : ['a', 'b'], + tags : [], + }, +}) + +export const mutations = { + increment(state) { + state.counter++ + }, + add(state, text) { + state.list.push({ + text, + done: false, + }) + }, + remove(state, { todo }) { + state.list.splice(state.list.indexOf(todo), 1); + }, + setFormField(state, { field }) { + state.formConfig[state.formConfig.indexOf(field)] = field; + }, + setFetchedDataOsm(state, { data }) { + state.fetchedData.osm_data = data; + }, + setFetchedDataAddok(state, { data }) { + state.fetchedData.addok_data = data; + }, + setTag(state, { field }) { + state.formConfig.tags[state.formConfig.tags.indexOf(field)] = field; + }, + setSelectedResult(state, { data }) { + state.selectedResult = data; + }, + setFetching(state, { data }) { + state.isFetching = data; + }, + setAllTag(state, { tags }) { + state.formConfig.tags = tags; + }, +} diff --git a/store/index.ts b/store/index.ts deleted file mode 100644 index 893d863..0000000 --- a/store/index.ts +++ /dev/null @@ -1,37 +0,0 @@ -/** - * see VueX docs - */ -export const state = () => ({ - counter: 0, - isFetching: false, - searchInput: '', - selectedResult: null, - list: [], - formConfig: { - name: '', - delivery: false, - hours: [], - tags: [], - }, -}) - -export const mutations = { - increment(state: any) { - state.counter++ - }, - add(state: any, text: any) { - state.list.push({ - text, - done: false, - }) - }, - remove(state: any, { todo }: any) { - state.list.splice(state.list.indexOf(todo), 1) - }, - 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 - }, -}