feat(store): complete store data

This commit is contained in:
tykayn 2021-01-21 12:34:21 +01:00 committed by Baptiste Lemoine
parent 2f818d63d1
commit dad54ffd2f
2 changed files with 17 additions and 6 deletions

View File

@ -17,7 +17,7 @@
<b-field label="Trouver mon Commerce par nom ou par SIREN">
<b-autocomplete
v-model="searchQuery"
v-model="$store.searchQuery"
:data="data"
placeholder="ex: Chambre du commerce d'Evry"
field="title"
@ -90,7 +90,7 @@
<section class="map">
<br />
( ici une carte )
<!-- <img src="~assets/carte_demo.png" alt="logo osm" />-->
<img src="~assets/carte_demo.png" alt="logo osm" />
</section>
<h2>Sélection:</h2>
<fieldset class="has-background-info">

View File

@ -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
},
}