这是我从用户那里获取数据的地方
<q-select v-model="select" :options="waiterHelp" float-label="Options" id="waiterHelp" />
<q-btn label="Continue" @click="waiterService()" id="askWaiterBtn" color="white" text-color="black" />
这是函数
waiterService(){
this.$store.dispatch('storeAskWaiter', this.select)
}
这是在商店中
state:{
// this variable saves the input asked by the guest in ask_waiter.vue
waiterServiceAsked: [
]
mutations : {
saveAskWaiter: (state, payload) =>{
state.waiterServiceAsked.push(payload) }
},
actions: {
storeAskWaiter: (context, payload) =>{
context.commit('saveAskWaiter', payload) }
},