簡體   English   中英

嘗試導入錯誤:“Typography”未從“antd”導出

[英]Attempted import error: 'Typography' is not exported from 'antd'

Antd 無法在特定的排版上編譯並在其他字體上完美編譯。

這是我在 antd-react 項目中包含的內容列表:

import {
  Input,
  Col,
  Row,
  Select,
  InputNumber,
  AutoComplete,
  Cascader,
  Option,
  Menu,
  Icon,
  Popover,
  Button,
  Form,
  Checkbox,
  InputGroup,
  DatePicker
} from "antd";

在這種情況下,每個 Typography 都希望Option無法編譯。

我已經嘗試重新安裝package.json文件。

如果您的意思是Select.Option ,則沒有這樣的組件Option在這種情況下,您需要:

import { Select } from 'antd';

const { Option } = Select;

使用搜索欄查找Option ,您會注意到它指的是Select

您可以在左側邊欄中檢查所有可用組件

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM