Answer the question
In order to leave comments, you need to log in
How to set condition in slider component?
To start, I have a SELECT that gives 2 fields to choose from ( ETH and BTC ).
<vSelect
:label="'Выберите базовый актив:'"
:options="underlyingList"
@change="getMaturity"
v-model="selectedCoin"
>
</vSelect>
<vue-slider
v-model="expectedMinPrice"
:marks="markSlider"
:interval="100"
:min="minSlider"
:max="maxSlider"
:step="stepSlider"
@change="changeMinPrice"
:enable-cross="false"
></vue-slider>
data() {
return {
value: 0,
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,
expectedMaxPrice: [0, 150000],
defolt_expectedMinPrice: [0, 150000],
defolt_expectedMaxPrice: [0, 150000],
sliderLabelsBtc: [0, 2000, 3000],
sliderLabelsEth: [0, 150, 400],
tableData: null,
underlyingChoice: [],
selectedCoin: null,
selectedDate: null,
selectedDirection: null,
coinAmount: 0,
description: "Description from DATA",
chartData: {},
max_slippage: null,
name: "null",
title: "Chart title from DATA",
sliderLabels: [],
timerId: null,
intervalTimerId: null,
markSlider: null,
};
},
async getMaturity(underlying) {
this.maturityList = await this.getMaturity_actions(underlying);
const result = await this.getStrikes_actions(this.selectedCoin); //BTC-ETH
console.log(".main_value", result[this.selectedCoin].main_value);
console.log("sub_value", result[this.selectedCoin].sub_value);
this.minSlider = result[this.selectedCoin].min;
this.maxSlider = result[this.selectedCoin].max;
this.stepSlider = result[this.selectedCoin].step;
this.expectedMinPrice = [...result[this.selectedCoin].main_value];
this.defolt_expectedMinPrice = [...result[this.selectedCoin].main_value];
this.expectedMaxPrice = [...result[this.selectedCoin].sub_value];
this.defolt_expectedMaxPrice = [...result[this.selectedCoin].sub_value];
/* this.setupSliderLabels(); */
this.selectedDate = null;
this.coinAmount = 0;
this.chartData = null;
this.max_slippage = null;
this.tableData = null;
this.selectedDirection = null;
this.futHedgeFlag_top = false;
this.futHedgeFlag_down = false;
this.saveDirection = false;
this.subDirectionFlag = false;
this.markSlider = v => !(v % 25000)
},
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question