3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 5 years have passed since last update.

[Vue.js] レンジ(スライド)の値をデータバインディングさせてみた

Last updated at Posted at 2019-05-28

やりたいこと

スクリーンショット 2019-05-28 21.19.30.png

上記のようなレンジをつくり、レンジの値をかえるたびに
データバインディングさせ、その値を表示させたい。

やったこと


<template>
  <div class="range" data-value="50">
    <div class="label" :style="{ left: rangeValue + '%' }">
      <div class="value">
        {{ rangeValue }}
      </div>
      <div class="drop" />
    </div>
    <div class="input-box">
      <input
        id="input-range"
        v-model="rangeValue"
        type="range"
        min="0"
        max="100"
        value="50"
      />
      <div class="bar" />
    </div>
  </div>
</template>

<script>
export default {
  name: 'BaseRange',
  data() {
    return {
      rangeValue: 50,
    }
  },
}
</script>

<style lang="scss" scoped>
@import '../../../assets/scss/object/component/range';
</style>

3
3
1

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
3

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?