我在我的应用程序的前端安装了antd,我在app.jsx上有这个
import "antd/dist/antd.css"
import { Button } from 'antd'现在,在我的第一个组件中,我尝试这样使用:
import antd from 'antd'
const { Card } = antd但现在我发现了这个错误
插件:vite:导入分析无法解析“./Component.jsx”中的导入"antd/es/default/style“。该文件存在吗?./Component.jsx:1:9\x{e76f}导入‘antd/es/default/style’;从“/@react-refresh”导入RefreshRuntime;\x^
在node_modules中,没有默认的'ant/es/ default‘文件夹
发布于 2022-09-13 19:30:54
如果您已将所有内容正确地安装到您的node_modules文件夹(例如npm install或yarn install),您应该能够导入antd/dist/antd.css或如果您只想拥有输入antd/es/input/style/index.css的样式
https://stackoverflow.com/questions/73708311
复制相似问题