C
C
ceeed2021-07-09 00:38:11
Vue.js
ceeed, 2021-07-09 00:38:11

How can I pass static data to slider label?

I need to somehow pass static data under the slider, as I understand it - this is called a label. I use the library https://nightcatsama.github.io/vue-slider-componen...
I don't understand how to do it. I created an array in data from the "dataLabel" data, and I want to substitute them under the slider when it rebuilds. Here is an example of my code:

<teamplate>
 <div class="mt-20">
          <vue-slider
            v-model="expectedMinPrice"
            :min="minSlider"
            :max="maxSlider"
            :step="stepSlider"
            @change="changeMinPrice"
            :enable-cross="false"
          ></vue-slider>
        </div>
</template>
<script>
data() {
    return {
      dataLabel: ['0', '10000', '20000', '30000', '40000', '50000', '60000','70000','80000','90000','100000','110000','120000','130000','140000','150000'],
      futHedgeFlag_down: false,
      futHedgeFlag_top: false,
      subDirectionFlag: false,
      saveDirection: false,
      minSlider: 0,
      maxSlider: 150000,
      stepSlider: 100,
      msg: "waiting",
      underlyingList: ["BTC", "ETH"],
      directionOptions: ["Up", "Down"],
      maturityList: [],
      expectedMinPrice: [0, 150000],
      expectedMaxPrice: [0, 150000],

      defolt_expectedMinPrice: [0, 150000],
      defolt_expectedMaxPrice: [0, 150000],data() {
    return {
      data: ['0', '10000', '20000', '30000', '40000', '50000', '60000','70000','80000','90000','100000','110000','120000','130000','140000','150000'],
      futHedgeFlag_down: false,
      futHedgeFlag_top: false,
      subDirectionFlag: false,
      saveDirection: false,
      minSlider: 0,
      maxSlider: 150000,
      stepSlider: 100,
      msg: "waiting",
      underlyingList: ["BTC", "ETH"],
      directionOptions: ["Up", "Down"],
      maturityList: [],
      expectedMinPrice: [0, 150000],
      expectedMaxPrice: [0, 150000],

      defolt_expectedMinPrice: [0, 150000],
      defolt_expectedMaxPrice: [0, 150000],
</script>

Answer the question

In order to leave comments, you need to log in

1 answer(s)
0
0xD34F, 2021-07-09
@ceeed

I understand - it's called a label

Do not understand

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question