reactjs - 在对话框中显示图表
问题描述
我有一些代码旨在在我的模式对话框上显示板的图像。目前,它不起作用,我认为这一定是我使用 getElementById 的原因。
有什么想法我可能做错了吗?我的非工作代码如下:
export const MyPiece = props => {
new Chessboard(document.getElementById('board2'), {
position:
'rn2k1r1/ppp1pp1p/3p2p1/5bn1/P7/2N2B2/1PPPPP2/2BNK1RR w Gkq - 4 11',
orientation: COLOR.black,
});
return (
<>
<DialogContent dividers>
<Typography paragraph="true">
Some text
</Typography>
<Paper id="board2"></Paper>
</DialogContent>
</>
);
};
解决方案
推荐阅读
- android - 以编程方式生成的 GridLayout 将列推到右侧
- ios - Firebase Crashlytics 迁移和查看仪表板
- python - Python while 循环即使在 false 时也会继续(即使变量声明为全局变量)
- react-native - React Native ScrollView 没有以完全对齐的方式分页
- javascript - 我在使用 MDB 网页上提供的 bootstrap 4 默认代码显示顶部和侧面导航菜单时遇到问题
- python-3.x - 使用“请求”模块抓取 Humble Bundle 游戏
- python - 结合后台任务和命令
- python-3.x - 如何修复 pyinstaller 缺少库错误
- reactjs - Gatsby 语言本地化(一键切换语言)
- python-3.x - Selenium 无法正确加载 html - Python3.8