react-admin,折叠菜单时图标消失,仅留下标签

时间:2019-01-15 13:17:58

标签: material-design material-ui admin-on-rest react-admin

作为标题。 图片中的细节

版本:

    "@material-ui/core": "^1.4.0",
    "@material-ui/icons": "^1.0.0",
    "ra-core": "^2.5.2",
    "react-admin": "^2.1.4",

未折叠

Not collapsed

崩溃

Collapsed

管理面板的

Root.js (删除了几行,如设置提供程序和类似资源):

import { Admin, Resource, fetchUtils } from 'react-admin';
import UserIcon from '@material-ui/icons/Group';
import AccountIcon from '@material-ui/icons/Payment';

const Root = () => (
  <Admin
    title="Administration"
    history={history}
    loginPage={LoginPage}
    authProvider={customAuthProvider}
    dataProvider={uploadCapableDataProvider}
    dashboard={Dashboard}
    customSagas={[formErrorSagas]}
    locale="de"
    i18nProvider={i18nProvider}
  >
    <Resource
      options={{ label: 'Kontomodelle' }}
      name="checking_account_variants"
      list={AccountVariants}
      create={AccountVariantCreate}
      edit={AccountVariantEdit}
      icon={AccountIcon}
    />
    <Resource
      options={{ label: 'Administratoren' }}
      name="admin_users"
      list={AdminUsers}
      create={AdminUsersCreate}
      edit={AdminUsersEdit}
      icon={UserIcon}
    />
  </Admin>
);

还有什么我应该添加的吗?

我正在最新的Chrome上对此进行测试。

更新

我想我发现了片刻。 我的任务是升级项目中的许多依赖项,并且我们已经package-lock.jsonyarn.lock在一起。当我开始时,我不再想要package-lock.json了,所以我删除了它,并开始使用yarn升级软件包。

这对我来说很奇怪,但是当我还原所有更改并在yarnpackage-lock.jsonyarn.lock时,一切正常,但是当我yarn仅使用{{ 1}}(无依赖性更改)-我可以观察到上述行为。很抱歉,我是软件包管理的新手,因此我不明白为什么会这样。

预更改:

yarn.lock

升级后

{
"dependencies": {
    "@material-ui/core": "^1.4.1",
    "@material-ui/icons": "^1.0.0-beta.17",
    "@rails/webpacker": "3.5",
    "assert": "^1.4.1",
    "axios": "^0.18.0",
    "babel-core": "^6.26.3",
    "babel-eslint": "8.2.5",
    "babel-polyfill": "^6.26.0",
    "babel-preset-react": "6.24.1",
    "bootstrap": "^4.1.1",
    "classnames": "^2.2.6",
    "connected-react-router": "^4.3.0",
    "crypto-js": "^3.1.9-1",
    "date-fns": "2.0.0-alpha.7",
    "eslint-config-prettier": "^3.3.0",
    "eslint-plugin-prettier": "^3.0.0",
    "file-saver": "^2.0.0-rc.3",
    "final-form": "^4.9.1",
    "history": "^4.7.2",
    "i18n-js": "3.0.9",
    "json-loader": "0.5.7",
    "json-stringify-safe": "^5.0.1",
    "jsonwebtoken": "^8.4.0",
    "lodash": "^4.17.11",
    "marked": "^0.5.1",
    "material-ui": "^0.20.2",
    "material-ui-pickers": "^1.0.0-rc.13",
    "normalizr": "^3.3.0",
    "prettier": "^1.15.3",
    "promise-polyfill": "^8.0.0",
    "prop-types": "15.6.2",
    "query-string": "5",
    "ra-core": "^2.1.3",
    "ra-data-json-server": "^2.1.4",
    "ra-language-german": "^2.1.1",
    "ramda": "^0.25.0",
    "react": "^16.6.3",
    "react-admin": "^2.1.4",
    "react-cookie": "^2.2.0",
    "react-cookie-consent": "^1.10.0",
    "react-dom": "16.4.1",
    "react-final-form": "^3.6.5",
    "react-redux": "^5.0.7",
    "react-router": "^4.3.1",
    "react-router-dom": "^4.3.1",
    "react-scrollchor": "^5.1.0",
    "recompose": "^0.30.0",
    "redux": "^4.0.0",
    "redux-form": "^7.4.2",
    "redux-persist": "^5.10.0",
    "redux-saga": "^0.16.0",
    "redux-thunk": "^2.3.0",
    "reselect": "^4.0.0",
    "svg-sprite-loader": "^3.8.0",
    "whatwg-fetch": "^2.0.4",
    "yaml-loader": "0.5.0"
  },
  "devDependencies": {
    "dotenv": "^6.1.0",
    "enzyme": "3.3.0",
    "enzyme-adapter-react-16": "1.1.1",
    "enzyme-to-json": "3.3.4",
    "eslint": "5.0.1",
    "eslint-config-airbnb": "^17.0.0",
    "eslint-import-resolver-webpack": "^0.10.1",
    "eslint-plugin-import": "^2.13.0",
    "eslint-plugin-jsx-a11y": "^6.1.0",
    "eslint-plugin-react": "^7.11.1",
    "expect": "^23.6.0",
    "fetch-mock": "^7.2.5",
    "jest": "23.2.0",
    "jest-localstorage-mock": "^2.4.0",
    "redux-mock-store": "^1.5.3",
    "stylelint": "^9.9.0",
    "stylelint-config-standard": "^18.2.0",
    "stylelint-declaration-use-variable": "^1.7.0",
    "stylelint-order": "^2.0.0",
    "webpack-dev-server": "2.11.2"
  },
}

0 个答案:

没有答案