[英]Attempted import error: 'Typography' is not exported from 'antd'
Antd failing to compile on specific Typographies and compiling perfectly on the others. Antd 无法在特定的排版上编译并在其他字体上完美编译。
This is the list of what I have included on my antd-react project:这是我在 antd-react 项目中包含的内容列表:
import {
Input,
Col,
Row,
Select,
InputNumber,
AutoComplete,
Cascader,
Option,
Menu,
Icon,
Popover,
Button,
Form,
Checkbox,
InputGroup,
DatePicker
} from "antd";
In this case, every Typography works expect Option
which fails to compile.在这种情况下,每个 Typography 都希望
Option
无法编译。
I have already tried re-installing the package.json
file.我已经尝试重新安装
package.json
文件。
There is no such component Option
if you mean Select.Option
in this case you need to:如果您的意思是
Select.Option
,则没有这样的组件Option
在这种情况下,您需要:
import { Select } from 'antd';
const { Option } = Select;
Use the search bar to look for Option
and you will notice it refers to Select
.使用搜索栏查找
Option
,您会注意到它指的是Select
。
You can check all the available components on the left sidebar.您可以在左侧边栏中检查所有可用组件。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.