【发布时间】:2021-01-02 17:04:23
【问题描述】:
我有以下反应组件:
render() {
return (
<div className="App">
<header className="App-header">
<AppBar position="static">
<ToolBar>
<Grid container>
<Grid conatiner justify="center" item lg={10}>
<p>The Game Of Life</p>
</Grid>
<Grid container direction="row" justify="flex-end" alignItems="center" item lg={2}>
<this.BarButton label="Clear" callBack={() => this.catchAction('clear')} />
<this.BarButton label="Go!" callBack={() => this.catchAction('go')}/>
</Grid>
</Grid>
</ToolBar>
</AppBar>
<Grid container directiorn="row" justify="center" alignItems="center" item lg={10}>
<canvas id="canvas" width="100vw" heigth="100vh" style={{border: '1px solid #000000'}}></canvas>
</Grid>
</header>
</div>
)
}
我希望画布适合AppBar 之后的整个屏幕,所以我尝试将答案应用于this question,但没有一个起作用,并且画布只覆盖了剩余屏幕的一小部分:
我还没有找到解决我的问题的其他方法。
【问题讨论】: