【问题标题】:Typography Material UI not found找不到排版材料 UI
【发布时间】:2018-04-05 21:43:42
【问题描述】:

在项目库中单独安装排版时,Material UI 库不响应。
该项目未编译并给出此错误

./src/App.js

找不到模块:无法解析“C:\Users\Sara Durrani\react\screenstask\src”中的“material-ui/Typography”

【问题讨论】:

  • npm install typeface-roboto --save 用这个命令试过
  • 如何导入?
  • 从“material-ui/Typography”导入排版;

标签: reactjs


【解决方案1】:

刚刚遇到同样的问题。显然现在你必须从 core 导入它:

import Typography from '@material-ui/core/Typography'

【讨论】:

    【解决方案2】:

    您将有这样的导入排版:

    import Typography from '@mui/material/Typography';
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2020-07-16
      • 2020-10-09
      • 1970-01-01
      • 1970-01-01
      • 2019-07-13
      • 2021-11-17
      • 2021-09-30
      • 1970-01-01
      相关资源
      最近更新 更多