如何在下拉列表中存储多次数据?

时间:2019-03-04 12:58:19

标签: quasar-framework quasar

这是我从用户那里获取数据的地方

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

0 个答案:

没有答案