I'm looking to trigger a function whenever a user changes a range slider in my Vue.js project, and I also need to pass the new value to that function. The code snippet below shows what I have so far.
<div
class="title title--danger "
:style="{color: this.$themes.danger}"
>Set Value</div>
<va-slider
color="danger"
value-visible
v-model="value"
/>
// Function definition
data(){
return{
value: ''
}
},
watch: {
value(newVal, oldVal){
alert('value = ' + newVal);
}
}