We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
const danmuContainer = () => { // 弹幕屏幕 const [screen, setScreen] = useState(null); // 弹幕内容 const [bullet, setBullet] = useState(""); const ref = useRef(null) useEffect(() => { let s = new BulletScreen(ref.current,{duration:10}); setScreen(s); }, []); // 弹幕内容输入事件处理 const handleChange = ({ target: { value } }) => { setBullet(value); }; // 发送弹幕 const handleSend = () => { if (bullet) { // push 纯文本 screen.push(bullet); } }; return ( <div className={style.danmu_container_root}> <div ref={ref} className={style.screen}></div> <input value={bullet} onChange={handleChange} /> <button onClick={handleSend}>发送</button> </div> ); };
The text was updated successfully, but these errors were encountered:
No branches or pull requests
const danmuContainer = () => { // 弹幕屏幕 const [screen, setScreen] = useState(null); // 弹幕内容 const [bullet, setBullet] = useState(""); const ref = useRef(null) useEffect(() => { let s = new BulletScreen(ref.current,{duration:10}); setScreen(s); }, []); // 弹幕内容输入事件处理 const handleChange = ({ target: { value } }) => { setBullet(value); }; // 发送弹幕 const handleSend = () => { if (bullet) { // push 纯文本 screen.push(bullet); } }; return ( <div className={style.danmu_container_root}> <div ref={ref} className={style.screen}></div> <input value={bullet} onChange={handleChange} /> <button onClick={handleSend}>发送</button> </div> ); };
The text was updated successfully, but these errors were encountered: