繁体   English   中英

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

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

我在论坛上看到有一种方法可以多次导入 Material UI 图标,所以我尝试从这里导入 go:

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

对此

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

但是当我尝试启动我的代码时,我遇到了这个问题

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

如果我尝试从“@mui/icons-material”或“@material-ui/icons”导入,我会遇到这些问题

尝试这个:

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

暂无
暂无

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

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM