iterate hours

This commit is contained in:
Tykayn 2021-01-22 13:45:28 +01:00 committed by tykayn
commit 35fee566d9
6 changed files with 48 additions and 12 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

@ -54,8 +54,6 @@
},
"husky": {
"hooks": {
"commit-msg": "commitlint -E HUSKY_GIT_PARAMS",
"pre-commit": "lint-staged"
}
},
"lint-staged": {

View File

@ -1,6 +1,6 @@
<template>
<section class="section">
<h1>à propos</h1>
<h1 class="title is-1">à propos</h1>
<p>
Lorem ipsum dolor sit amet, consectetur adipisicing elit. Aliquid aperiam
corporis eum natus odio recusandae sapiente sunt suscipit voluptate,

View File

@ -2,11 +2,12 @@
<section class="section">
<h1>Horaires</h1>
<p>Vos horaires actuelles</p>
<iframe
src="https://projets.pavie.info/yohours/"
frameborder="0"
width="100%"
height="800"
></iframe>
<ul v-if="store.state.hours">
<li v-for="(h,index) in store.state.hours">
<div :key="index" class="hour">
{{ h }}
</div>
</li>
</ul>
</section>
</template>

View File

@ -9,7 +9,7 @@ export default new Vuex.Store({
searchQuery: '',
select: {},
searchResults: [],
hours: [],
hours: ['Lu-We 08:00 - 09:00', 'Lu-We 10:00 - 22:00'],
osm_data: {},
},
mutations: {

37
store/index.ts Normal file
View File

@ -0,0 +1,37 @@
/**
* 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
},
}