0

I want to call a function for date range can call the function by selecting particular options from the select list after selecting particular option regarding it, particular function must get a call and should fetch record ????

I'm trying it by using onChange() but it wont work. How to resolve it?

Roman Pokrovskij
  • 9,449
  • 21
  • 87
  • 142
ShrJoshi
  • 325
  • 1
  • 6
  • 13
  • 1
    Welcome to StackOverflow. Please have a look [here](stackoverflow.com/help/how-to-ask) maybe you will get more answers – Angel M. Jan 09 '19 at 07:11
  • https://stackoverflow.com/questions/50982408/vue-js-get-selected-option-on-change – Cübe Jan 09 '19 at 07:20

1 Answers1

0

Within the onChange method you put your own logic for the date range

new Vue({
        el: "#app",
        data: {
            key: ""
        },
        methods: {
            onChange() {
               console.log(this.key)
            }
        }
    })
<script src="https://cdnjs.cloudflare.com/ajax/libs/vue/2.5.17/vue.js"></script>
<div id="app">
        <select name="LeaveType" @change="onChange()" class="form-control" v-model="key">
            <option value="1">Annual Leave/ Off-Day</option>
            <option value="2">On Demand Leave</option>
         </select>
    </div>
Cübe
  • 71
  • 4