简体   繁体   English

为什么我尝试在 mui 图标中多次导入图标时出现错误?

[英]Why do I have an error when I try a multiple import of icons in mui icons?

I saw on the forum that there is a way to do a multiple import of Material UI icons, so I tried to go from this:我在论坛上看到有一种方法可以多次导入 Material UI 图标,所以我尝试从这里导入 go:

import InterestsRoundedIcon from "@mui/icons-material/InterestsRounded";
import AccountCircleRoundedIcon from "@mui/icons-material/AccountCircleRounded";
import SettingsRoundedIcon from "@mui/icons-material/SettingsRounded";

to this对此

import { InterestsRoundedIcon, AccountCircleRoundedIcon, SettingsRoundedIcon } from "@mui/icons-material";

but when I try to launch my start my code I got this issue但是当我尝试启动我的代码时,我遇到了这个问题

Compiled with problems: ERROR in./src/components/sidebar/Sidebar.jsx 44:42-62 export 'InterestsRoundedIcon' (imported as 'InterestsRoundedIcon') was not found in >'@mui/icons-material'编译有问题:错误 in./src/components/sidebar/Sidebar.jsx 44:42-62 export 'InterestsRoundedIcon' (imported as 'InterestsRoundedIcon') was not found in >'@mui/icons-material'

and I got those problems if i try to import either from "@mui/icons-material" or "@material-ui/icons"如果我尝试从“@mui/icons-material”或“@material-ui/icons”导入,我会遇到这些问题

Try this:尝试这个:

import {
  InterestsRounded as InterestsRoundedIcon,
  AccountCircleRounded as AccountCircleRoundedIcon,
  SettingsRounded as SettingsRoundedIcon,
} from "@mui/icons-material";

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 当我尝试安装反应图标时收到一条错误消息 - I am getting an error message when I try to install react icons 我有两张图标幻灯片,当第一张幻灯片中的图标以不同的分辨率溢出时,如何将图标移动到下一张幻灯片? - I have two slides of icons and how to move the icons to next slide when the icons are overflowing in first slide at different resolutions? 无法从@mui/icons-material 导入图标 - Unable to import icons from @mui/icons-material 当我尝试在 React Native 中导入我的组件时出错 - have an error when i try import my component in react native 为什么当我尝试 `this.store.commit()` 时出现错误 `injection "store" not found`? - Why do I have the error `injection "store" not found` when I try `this.store.commit()`? 如何在多个按钮上切换相同的 fa fa 图标? - How do I toggle the same fa fa icons on multiple buttons? 如何使用fabric js中的循环创建多个图标? - How do I create multiple icons using loops in fabric js? React 图标:我应该使用哪个导入? - React icons: Which import should I use? 添加此代码后,为什么我的图标被更改了? - Why are my icons being changed when i add this code? 如何向 StandardListItem 添加两个图标 - How do I add two icons to StandardListItem
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM