ion-rangeslider not getting displayed

大城市里の小女人 提交于 2019-12-12 05:57:32

问题


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 this

should be like this

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?

来源:https://stackoverflow.com/questions/44342502/ion-rangeslider-not-getting-displayed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!