I am trying to pass the selected values from the tag and pass it to a button’s click event. However, I was not able to get the data in the onclick function. See the code below.
I am getting undefined in the alert.
Please help.
<div class=“form-group”>
<div class=“form-group” align=“center”>
<label for=“select-Year”>Select CMS Fiscal Year :</label>
<select class=“form-control input-sm” style=“width:120px” id=“select-Year”>
<option v-for=“yr in years” value=“yr”>{{ yr }}</option>
</select>
</div>
<br/><br/>
<div class=“form-group” style=“align:center”>
<button id=“btnSubmit” class=“btn btn-primary” style=“align:center” v-on:click=“loadData(yr, $event)”>Open</button>
</div>
</div>
methods: {
`loadData`: function(yr, event){
alert(yr);
}
}