Twitter bootstrap jsx中ReactJS中的引导范围滑块

Twitter bootstrap jsx中ReactJS中的引导范围滑块,twitter-bootstrap,reactjs,rangeslider,Twitter Bootstrap,Reactjs,Rangeslider,我想在引导中选择一个有两个滑块的范围。我已经这样做了,但不起作用 render: function () { return ( <input type="range" value={this.props.value} min={this.props.min} max={this.props.max} on Input={this .props .h

我想在引导中选择一个有两个滑块的范围。我已经这样做了,但不起作用

render: function () {
    return (
        <input
            type="range"
            value={this.props.value}
            min={this.props.min}
            max={this.props.max}
            on Input={this .props .handle Change}
            step={this.props.step} />
    );
}
render:function(){
返回(
);
}
但是我想要两个范围滑块。我现在要做什么?
我想根据滑块值选择值

我在开发web应用程序时遇到了相同的问题。我在npm中找到了一些范围滑块。但是,react nouislier是我解决你问题的建议

装置

npm install react-nouislider --save
用法


您可以在此处找到npm链接

这是我的案例,它有效:

<label>Opacity</label>
<input type="range" className="custom-range" id="customRange" 
min="0.1" max="1.0" step="0.05" 
value={this.state.opacity}
onChange={event => this.setState({ opacity: event.target.value })} >
</input>

我在react项目中使用了Bootstrap4。再见

iam正在使用jsx文件,iam无法使用导入,并且不使用require。除此之外还有其他方法吗?您也可以使用require。导入是es6格式的require。不要把它分配给任何变量,只需要它。此外,您还可以将其添加到html页面的src中@Arronjsx还支持导入和请求。只需在创建react类
react.createClass()
之前使用它即可。就像您在我的jsx中使用“React”导入或要求
React
一样,这表明require没有定义,我在这里缺少什么,请指导我。。。
import '(path_to_your_node_modules_folder)/node_modules/nouislider/src/nouislider.css';
import '(path_to_your_node_modules_folder)/node_modules/nouislider/src/nouislider.tooltips.css';
import '(path_to_your_node_modules_folder)/node_modules/nouislider/src/nouislider.pips.css';
<label>Opacity</label>
<input type="range" className="custom-range" id="customRange" 
min="0.1" max="1.0" step="0.05" 
value={this.state.opacity}
onChange={event => this.setState({ opacity: event.target.value })} >
</input>
componentWillMount() {
    this.setState({
      opacity : 0.9 
    });
  }