<template>
  <q-range v-model="valueInner" v-bind="$attrs" @input="moveMin" />
</template>
<script>
export default {
  name: 'KybRange',
  model: {
    prop: 'value',
    event: 'input'
  },
  props: { value: Object, minReadonly: Boolean },
  data() {
    return { valueInner: this.value }
  },
  watch: {
    value(newVal) {
      this.valueInner = newVal
    }
  },
  methods: {
    moveMin(v) {
      console.log(v)
      v.min = v.min > 0 ? 0 : v.min
      this.$emit('input', v)
    }
  }
}
</script>
