【发布时间】:2019-03-17 09:18:26
【问题描述】:
我已经尝试了几乎所有方法来为反应组件设置高度,但它似乎不起作用,但是当我以同样的方式设置宽度时它起作用了!我正在使用 Material-ui 中的<card>。
这是一个例子:
const Sty1={
height:'100%'
}
const Threads = React.createClass({
render: function() {
return (
<Card style={Sty1}>
*other stuff*
</Card>
);
}
});
【问题讨论】:
-
这是错字吗?你声明
Sty1,但使用st1。 -
我犯了一个错误,应该是 Sty1。生病更新问题
-
不应该是
const Sty1 = { height: 100%; }(所以没有引号) -
Nop ive 已经尝试过了,它给出了一个语法错误
标签: reactjs material-ui