gpt4 book ai didi

reactjs - Material-ui-next - 版式

转载 作者:行者123 更新时间:2023-12-02 04:09:13 25 4
gpt4 key购买 nike

我有使用material-ui 1.0.0-beta 31的以下组件。版式样式不会显示在页面上,并且所有文本都具有相同的样式。有人可以解释一下我做错了什么吗?

import React from 'react';
import Typography from 'material-ui/Typography';

const LearningPage = (props, { authUser }) =>
<div>
<Typography variant="headline" component="h2">
benevent
</Typography>
<Typography >adjective</Typography>
<Typography component="p">
well meaning and kindly.<br />
{'"a benevolent smile"'}
</Typography>
<Typography variant="headline" gutterBottom>
Headline
</Typography>
</div>

export default LearningPage;

最佳答案

material-ui 1.0.0-beta 31 中不存在 variant 属性。如 the release notes 中所述。 ,variant 属性是在 beta 32 中引入的。

在 beta 32 之前,type 属性与 variant 属性具有相同的作用。这是commit进行更改的位置,这里是 the issue如果您有兴趣,可以在其中讨论更改。

因此,您有两种选择来解决此问题:

  1. 升级到 beta 32。
  2. 保持 beta 31 不变,并将 variant 重命名为 type

关于reactjs - Material-ui-next - 版式,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/48653318/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com