【发布时间】:2019-05-12 11:51:36
【问题描述】:
我正在尝试使用以下方法设置 div 的类名:
render() {
const textStyle = {
position: "absolute",
top: "200px",
left: "200px"
}
return (
<Layout>
<div>
<div>
<div className={textStyle}> My text is Test</div>
</div>
</div>
</Layout>
)
}
}
但是,当我检查时,我得到的只是
<div class="[object Object]"> My text is Test</div>
我不确定为什么这不起作用。
我可以使用 Bulma 修饰符了
【问题讨论】: