This commit is contained in:
Jonathan Chevalier
2022-09-27 17:47:09 +02:00
parent 3f9ddcac6d
commit c0ef555cea
9 changed files with 260 additions and 84 deletions

View File

@@ -1,9 +1,19 @@
import {defineStore} from 'pinia'
export const useMMCMStore = defineStore('counter', {
state: () => ({street: '', zipCode: '', city: '', productList: [], withPrescription: null, idProduct: null, dateDelivery:null}),
state: () => ({
street: '',
zipCode: '',
city: '',
productList: [],
withPrescription: null,
idProduct: null,
dateDelivery: null
}),
getters: {
fullAddress: (state) => state.street + ' ' + state.zipCode + '' + state.city,
deliveryMethod: (state) => state.productList.filter(p => p.id === state.idProduct)[0].name,
dateDeliveryString: (state) => new Date(state.dateDelivery).toLocaleDateString("fr-FR")
},
actions: {
setStreet(street) {