簡體   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