4
4
4sadly2021-02-07 19:08:07
css
4sadly, 2021-02-07 19:08:07

How to make a range with this thing?

602010430784b878069645.jpeg
6020104853057108822425.jpeg
How to make it so that its location depends on the entered data?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
D
dicem, 2021-02-07
@dicem

Make a prop for the component and initialize the component with this prop's in mind. In general
, provide the code, who will help you without it?

E
elyasa, 2021-02-09
@elyasa

Easily. using jquery. In principle, everything is the same for Vue, only the syntax is different.

var my_slider = {
    value: {
        min_range: 10,
        max_range: 20,
        min_value: 0,
        max_value: 50,
        current_value: 15
    },
    set_min_range: function (_new_value) {
        if (_new_value >= this.value.max_range || _new_value < this.value.min_value) {
            return this.value.min_range
        } else {
            this.value.min_range = _new_value;

            if (this.value.current_value < _new_value) {
                this.value.current_value = _new_value;
            }
            return this.value.min_range
        }
    },
    set_max_range: function (_new_value){
        if (_new_value > this.value.max_value || _new_value <= this.value.min_range ) {
            return this.value.max_range
        } else {
            this.value.max_range = _new_value;
            if (this.value.current_value < _new_value) {
                this.value.current_value = _new_value;
            }
            return this.value.max_range
        }
    },
    set_current_value: function(_new_value) {
        if (_new_value < this.value.min_range || _new_value > this.value.max_range) {
            return this.value.current_value
        } else {
            this.value.current_value = _new_value;
            return this.value.current_value
        }
    }
    render: function() {
        // Вот здесь пишите функции для отрисовки HTML элеменитов исходя из
        // значений в словаре this.value . Во VueJS это будет будет делаться автоматически
    }
}

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question