D
D
danilr2019-05-07 12:45:44
JavaScript
danilr, 2019-05-07 12:45:44

Slider plugin for Vue throws an error, how can I fix it?

I use this slider plugin https://www.npmjs.com/package/vue-slider-component

<v-slider
@drag-end="setPriceFilter"
v-model="rangeSum"
:enable-cross="false"
:min="allRcMinPrice"
:max="allRcMaxPrice"
:interval="100000"
></v-slider>

rangeSum: {
      get() {
        let rangeSum = [this.minSum, this.maxSum];
        return rangeSum;
      },
      set(value) {
        this.minSum = value[0];
        this.maxSum = value[1];
      }
    },

The task is that when I click on a certain button, the border (minimum value) changes.
I do it like this:
if(this.minSum < this.newMinPrice){ // этим условием пытался исправить эту ошибку
          this.minSum = this.newMinPrice //устанавливаю min value
          this.setNewAllMinPrice(this.newMinPrice) // устанавливаю min границу( через Vuex)
        }
        else{
          this.minSum = this.newMinPrice
          this.setNewAllMinPrice(this.newMinPrice)
        }

This works, but keeps throwing an error every time it's used.
How can I get rid of the error?
5cd1536987077258957794.png

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question