【问题标题】:No baseThemes inside 'material-ui' npm package'material-ui' npm 包内没有 baseThemes
【发布时间】:2018-03-02 12:12:35
【问题描述】:

我决定尝试 http://www.material-ui.com/ 与 darkBaseTheme。

但是当我通过安装包时

npm i --save material-ui

我得到了没有样式/baseTheme 文件夹的包。这就是为什么我不能使用来自example 的代码导入这个主题:

...
import darkBaseTheme from 'material-ui/styles/baseThemes/darkBaseTheme';
...

谁能告诉我我做错了什么?我有点卡在这里

【问题讨论】:

  • 我刚刚尝试使用 create-react-app 创建的空白应用程序。我以与您相同的方式安装了 material-ui,它为项目带来了 0.20.0 版本,并且导入工作正常。你的 package.json 中有哪个版本的 material-ui?
  • "material-ui": "^0.20.0"
  • 这很奇怪,似乎我们的设置相同。您是否尝试卸载并重新安装依赖项?然后,检查 npm 日志。
  • 如果您刚刚开始使用 material-ui,you should use v1
  • 谢谢你们!我发现在最新版本中没有baseThemes。

标签: reactjs themes material-design material-ui


【解决方案1】:

看起来在最新的 v1-beta baseThemes 中根本没有包含。

Here is the repository with the last commit at that moment

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 2021-10-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2018-09-10
    相关资源
    最近更新 更多