aboutsummaryrefslogblamecommitdiff
path: root/resources/js/components/call-sign-filter.vue
blob: 16eaae8318243fb0620ebcba458c6ce91d25d1f8 (plain) (tree)
1
2
3
4
5
6
7
8
          



                                                               
                                                                                                            

             



                
             
                                      

             

               
                                                   

                  
                                                       
                                   

       
               
                                          

     

         
<template>
  <div>
    <label for="call-sign">Filter by special callsign: </label>
    <select id="call-sign" v-model="selected">
      <option value="all">All</option>
      <option v-for="option in options" :key="option.id" :value="option.sign" v-text="option.sign"></option>
    </select>
  </div>
</template>

<script>
export default {
  mounted() {
    this.$store.dispatch('pullSigns');
  },
  computed: {
    selected: {
      get() {
        return this.$store.getters.getSelectedSign;
      },
      set(value) {
        this.$store.dispatch('setSelectedSign', value);
        this.$emit('sign-changed');
      }
    },
    options() {
      return this.$store.getters.getSigns;
    }
  }
}
</script>