ion-rangeslider not getting displayed

2019-09-16 04:24发布

I am trying to use ion-rangeslider in my react application. But it is not showing up with ui on webpage. I am initializing it my componentDidMount method like this

componentDidMount = () => {

    $("#ionSlider-newTag").ionRangeSlider({
        min: 0,
        max: 5000,
        type: 'double',
        postfix: 's',
        maxPostfix: "+",
        prettify: false,
        hasGrid: true,
        from: 1600,
        to: 2950
    });

But on webpage it is getting showed like thisenter image description here

should be like thisenter image description here

I also tried to initialize without using jquery

var slider = document.getElementById('ionSlider-newTag');

        ionRangeSlider.create(slider,{
            min: 0,
            max: 5000,
            type: 'double',
            postfix: 's',
            maxPostfix: "+",
            prettify: false,
            hasGrid: true,
            from: 1600,
            to: 2950
        });

But it gave me error saying

Uncaught TypeError: _ionRangeslider2.default.create is not a function

I used create to initialize noUiSlider, and it worked there. But create didn't work with ionrangeslider.

How can I slove this complete problem?

0条回答
登录 后发表回答