Material UI 中缺少组件
Missing components in Material UI
Material UI 的每个组件都工作正常,但是当我第一次尝试使用 ImageList 和 ImageListItem 时出现此错误
ERROR in ./client/src/user-imageboard.js 3:0-52
Module not found: Error: Can't resolve '@material-ui/core/ImageList' in '/home/carlos/spiced/spiced-final-project/client/src'
@ ./client/src/profile.js 13:0-47 58:26-40
@ ./client/src/app.js 17:0-32 43:35-42
@ ./client/src/start.js 10:0-24 25:32-35
ERROR in ./client/src/user-imageboard.js 4:0-60
Module not found: Error: Can't resolve '@material-ui/core/ImageListItem' in '/home/carlos/spiced/spiced-final-project/client/src'
@ ./client/src/profile.js 13:0-47 58:26-40
@ ./client/src/app.js 17:0-32 43:35-42
@ ./client/src/start.js 10:0-24 25:32-35
我查看了 node_modules 文件夹,但它不在那里。我试图删除文件夹@material-ui/core并重新安装,但仍然没有。
找不到该组件。 material-ui 的版本是 @material-ui/core": "^4.11.2"
这是我导入和嵌套的组件。
import ImageList from '@material-ui/core/ImageList';
import ImageListItem from '@material-ui/core/ImageListItem';
const UserImageBoard = () => {
return (
<ImageList variant="masonry" cols={3} gap={8}>
<ImageListItem>
<img src="/default.jpg"> </img>
</ImageListItem>
<ImageListItem>
<img src="/default.jpg"> </img>
</ImageListItem>
<ImageListItem>
<img src="/default.jpg"> </img>
</ImageListItem>
</ImageList>
);
};
export default UserImageBoard;
Material UI 的每个组件都工作正常,但是当我第一次尝试使用 ImageList 和 ImageListItem 时出现此错误
ERROR in ./client/src/user-imageboard.js 3:0-52
Module not found: Error: Can't resolve '@material-ui/core/ImageList' in '/home/carlos/spiced/spiced-final-project/client/src'
@ ./client/src/profile.js 13:0-47 58:26-40
@ ./client/src/app.js 17:0-32 43:35-42
@ ./client/src/start.js 10:0-24 25:32-35
ERROR in ./client/src/user-imageboard.js 4:0-60
Module not found: Error: Can't resolve '@material-ui/core/ImageListItem' in '/home/carlos/spiced/spiced-final-project/client/src'
@ ./client/src/profile.js 13:0-47 58:26-40
@ ./client/src/app.js 17:0-32 43:35-42
@ ./client/src/start.js 10:0-24 25:32-35
我查看了 node_modules 文件夹,但它不在那里。我试图删除文件夹@material-ui/core并重新安装,但仍然没有。
找不到该组件。 material-ui 的版本是 @material-ui/core": "^4.11.2"
这是我导入和嵌套的组件。
import ImageList from '@material-ui/core/ImageList';
import ImageListItem from '@material-ui/core/ImageListItem';
const UserImageBoard = () => {
return (
<ImageList variant="masonry" cols={3} gap={8}>
<ImageListItem>
<img src="/default.jpg"> </img>
</ImageListItem>
<ImageListItem>
<img src="/default.jpg"> </img>
</ImageListItem>
<ImageListItem>
<img src="/default.jpg"> </img>
</ImageListItem>
</ImageList>
);
};
export default UserImageBoard;