<Slider
min={-10}
max={10}
style={{
width: slider_width ? slider_width : "100px",
color: "gray",
marginLeft: "10px",
marginRight: "10px",
}}
defaultValue={0}
aria-labelledby="continuous-slider" // "discrete-slider-always"
// step={1}
valueLabelDisplay="on"
value={value}
track={false}
onChange={check_color}
ref={value_slider}
/>
const [value, set_value] = useState(0);
const check_color = (e, v) => {
set_value(v);
};
为什么不是连续的?我该怎么做?
答案 0 :(得分:2)
默认情况下,属性 step
为 1。我们不能将其设置为 null,因为在这种情况下
拇指只能滑到标记道具提供的标记上
我们所能做的就是为它设置一个更合适的值,比如step={0.001}