V
V
VctorIAN2021-06-23 09:05:33
Vue.js
VctorIAN, 2021-06-23 09:05:33

Is it possible to use v-model analog to set max, min in input type="range"?

Hello, I can use
<input type="range" v-model="liters" />and describe liters in data

data() {
    return {
      liters: 0,
      litersMin: 0,
      litersMax: 100,
    };
  },
but how do i bind also min and max value in range - so they are also reactive

Answer the question

In order to leave comments, you need to log in

1 answer(s)
W
wakenbyWork, 2021-06-23
@VctorIAN

<template>
  <input type="range" v-bind:min="litersMin" v-bind:max="litersMax" v-model="liters" />
</template>

<script>
export default {
  data() {
    return {
      liters: 0,
      litersMin: 0,
      litersMax: 100
    }
  }
}
</script>

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question