问题
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