从React-Color库实现sliderpicker
我找不到有关如何实现滑动器作为功能组件的正确示例,有什么建议吗?
import React,{useState} from "react";
import "../Styles/Pixel-editor.scss"
import { HuePicker,SliderPicker } from 'react-color';
function App(){
return(<div className="App"><SliderPicker/> </div>);
}
I can't find a proper example on how to implement the SliderPicker as a functional component, any suggestions?
import React,{useState} from "react";
import "../Styles/Pixel-editor.scss"
import { HuePicker,SliderPicker } from 'react-color';
function App(){
return(<div className="App"><SliderPicker/> </div>);
}
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
您需要一个具有对象的状态,该状态具有 hex 属性。然后,您可以使用 onchangecomplete 属性进行设置:
htttps:htttps:// codesandbox。 io/s/s/抛光 - 谐音-5il68w
You need a state with object, which has a hex property. Then you can set it with onChangeComplete property:
https://codesandbox.io/s/polished-resonance-5il68w