We will learn how to get selected option value of dropdown in vue js.
Example:
<!DOCTYPE html>
<html>
<head>
<title>Vue JS Get Dropdown Selected Value Example - rathorji.in</title>
<script src="https://cdn.jsdelivr.net/npm/vue"></script>
</head>
<body>
<div id="app">
<select name="category_id" @change="onChange($event)" class="form-control">
<option>--- Select Category ---</option>
<option value="1">PHP</option>
<option value="2">Laravel</option>
<option value="3">Codeigniter</option>
<option value="4">Vue JS</option>
<option value="5">Angular JS</option>
</select>
</div>
<script type="text/javascript">
var app = new Vue({
el: '#app',
methods: {
onChange(event) {
console.log(event.target.value);
}
}
})
</script>
</body>
</html>
I hope this will help you...