How can I update or show the actual value of a range input in Vue 3?
I thought it would be possible wiht v-model like this:
<input type="range" v-model="value" min="0" max="5" step="0.2"/> <label for="rangeSlider"> Value: {{ value }} m </label> 1 Answer
It actually works exactly the same as the Vue2, just a little bit different Vue setup
const app = Vue.createApp({ data: () => ({ value: 0 }) }) const vm = app.mount('#app')<script src="[email protected]/dist/vue.global.js"></script> <div> <input type="range" v-model="value" min="0" max="5" step="0.2"/> <label for="rangeSlider"> Value: {{ value }} m </label> </div>