rc-bullets icon indicating copy to clipboard operation
rc-bullets copied to clipboard

引用到Chrome extension中弹幕不显示

Open OMP1024 opened this issue 1 year ago • 0 comments

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> ); };

image

OMP1024 avatar Nov 14 '22 07:11 OMP1024