docs: replace lib with es (#36367)

This commit is contained in:
MadCcc 2022-07-04 22:09:54 +08:00 committed by GitHub
parent 9bc30d1ed1
commit ab19033876
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
68 changed files with 77 additions and 77 deletions

View File

@ -15,7 +15,7 @@ A basic calendar component with Year/Month switch.
```tsx
import { Calendar } from 'antd';
import type { CalendarMode } from 'antd/lib/calendar/generateCalendar';
import type { CalendarMode } from 'antd/es/calendar/generateCalendar';
import type { Moment } from 'moment';
import React from 'react';

View File

@ -15,7 +15,7 @@ Nested inside a container element for rendering in limited space.
```tsx
import { Calendar } from 'antd';
import type { CalendarMode } from 'antd/lib/calendar/generateCalendar';
import type { CalendarMode } from 'antd/es/calendar/generateCalendar';
import type { Moment } from 'moment';
import React from 'react';

View File

@ -15,7 +15,7 @@ Customize Calendar header content.
```tsx
import { Calendar, Col, Radio, Row, Select, Typography } from 'antd';
import type { CalendarMode } from 'antd/lib/calendar/generateCalendar';
import type { CalendarMode } from 'antd/es/calendar/generateCalendar';
import type { Moment } from 'moment';
import React from 'react';

View File

@ -16,7 +16,7 @@ There are 4 position options available.
```tsx
import type { RadioChangeEvent } from 'antd';
import { Carousel, Radio } from 'antd';
import type { DotPosition } from 'antd/lib/carousel';
import type { DotPosition } from 'antd/es/carousel';
import React, { useState } from 'react';
const contentStyle: React.CSSProperties = {

View File

@ -44,7 +44,7 @@ import {
Tree,
TreeSelect,
} from 'antd';
import type { DirectionType } from 'antd/lib/config-provider';
import type { DirectionType } from 'antd/es/config-provider';
import React, { useState } from 'react';
const InputGroup = Input.Group;

View File

@ -29,8 +29,8 @@ import {
TimePicker,
Transfer,
} from 'antd';
import enUS from 'antd/lib/locale/en_US';
import zhCN from 'antd/lib/locale/zh_CN';
import enUS from 'antd/es/locale/en_US';
import zhCN from 'antd/es/locale/zh_CN';
import moment from 'moment';
import 'moment/locale/zh-cn';
import React, { useState } from 'react';

View File

@ -26,7 +26,7 @@ import {
Table,
Tabs,
} from 'antd';
import type { SizeType } from 'antd/lib/config-provider/SizeContext';
import type { SizeType } from 'antd/es/config-provider/SizeContext';
import React, { useState } from 'react';
const { TabPane } = Tabs;

View File

@ -49,7 +49,7 @@ Some components use dynamic style to support wave effect. You can config `csp` p
| getTargetContainer | Config Affix, Anchor scroll target container | () => HTMLElement | () => window | 4.2.0 |
| iconPrefixCls | Set icon prefix className (cooperated with [@iconfont-css-prefix](https://github.com/ant-design/ant-design/blob/d943b85a523bdf181dabc12c928226f3b4b893de/components/style/themes/default.less#L106)) | string | `anticon` | 4.11.0 |
| input | Set Input common props | { autoComplete?: string } | - | 4.2.0 |
| locale | Language package setting, you can find the packages in [antd/lib/locale](http://unpkg.com/antd/lib/locale/) | object | - | |
| locale | Language package setting, you can find the packages in [antd/es/locale](http://unpkg.com/antd/es/locale/) | object | - | |
| pageHeader | Unify the ghost of PageHeader, ref [PageHeader](/components/page-header) | { ghost: boolean } | true | |
| prefixCls | Set prefix className (cooperated with [@ant-prefix](https://github.com/ant-design/ant-design/blob/2c6c789e3a9356f96c47aea0083f5a15538315cf/components/style/themes/default.less#L7)) | string | `ant` | |
| renderEmpty | Set empty content of components. Ref [Empty](/components/empty/) | function(componentName: string): ReactNode | - | |

View File

@ -50,7 +50,7 @@ export default () => (
| getTargetContainer | 配置 Affix、Anchor 滚动监听容器。 | () => HTMLElement | () => window | 4.2.0 |
| iconPrefixCls | 设置图标统一样式前缀。注意:需要配合 `less` 变量 [@iconfont-css-prefix](https://github.com/ant-design/ant-design/blob/d943b85a523bdf181dabc12c928226f3b4b893de/components/style/themes/default.less#L106) 使用 | string | `anticon` | 4.11.0 |
| input | 设置 Input 组件的通用属性 | { autoComplete?: string } | - | 4.2.0 |
| locale | 语言包配置,语言包可到 [antd/lib/locale](http://unpkg.com/antd/lib/locale/) 目录下寻找 | object | - | |
| locale | 语言包配置,语言包可到 [antd/es/locale](http://unpkg.com/antd/es/locale/) 目录下寻找 | object | - | |
| pageHeader | 统一设置 PageHeader 的 ghost参考 [PageHeader](/components/page-header) | { ghost: boolean } | true | |
| prefixCls | 设置统一样式前缀。注意:需要配合 `less` 变量 [@ant-prefix](https://github.com/ant-design/ant-design/blob/2c6c789e3a9356f96c47aea0083f5a15538315cf/components/style/themes/default.less#L7) 使用 | string | `ant` | |
| renderEmpty | 自定义组件空状态。参考 [空状态](/components/empty/) | function(componentName: string): ReactNode | - | |

View File

@ -39,7 +39,7 @@ import locale from 'antd/es/date-picker/locale/zh_CN';
// The default locale is en-US, if you want to use other locale, just set locale in entry file globally.
import moment from 'moment';
import 'moment/locale/zh-cn';
import locale from 'antd/lib/locale/zh_CN';
import locale from 'antd/es/locale/zh_CN';
<ConfigProvider locale={locale}>
<DatePicker defaultValue={moment('2015-01-01', 'YYYY-MM-DD')} />

View File

@ -40,7 +40,7 @@ import locale from 'antd/es/date-picker/locale/zh_CN';
// 默认语言为 en-US如果你需要设置其他语言推荐在入口文件全局设置 locale
import moment from 'moment';
import 'moment/locale/zh-cn';
import locale from 'antd/lib/locale/zh_CN';
import locale from 'antd/es/locale/zh_CN';
<ConfigProvider locale={locale}>
<DatePicker defaultValue={moment('2015-01-01', 'YYYY-MM-DD')} />

View File

@ -21,7 +21,7 @@ import {
RadiusUprightOutlined,
} from '@ant-design/icons';
import { Button, Divider, notification, Space } from 'antd';
import type { NotificationPlacement } from 'antd/lib/notification';
import type { NotificationPlacement } from 'antd/es/notification';
import React from 'react';
const Context = React.createContext({ name: 'Default' });

View File

@ -23,7 +23,7 @@ import {
RadiusUprightOutlined,
} from '@ant-design/icons';
import { Button, Divider, notification, Space } from 'antd';
import type { NotificationPlacement } from 'antd/lib/notification';
import type { NotificationPlacement } from 'antd/es/notification';
import React from 'react';
const openNotification = (placement: NotificationPlacement) => {

View File

@ -15,7 +15,7 @@ Using `marks` property to mark a graduated slider, use `value` or `defaultValue`
```tsx
import { Slider } from 'antd';
import type { SliderMarks } from 'antd/lib/slider';
import type { SliderMarks } from 'antd/es/slider';
import React from 'react';
const marks: SliderMarks = {

View File

@ -15,7 +15,7 @@ The vertical Slider.
```tsx
import { Slider } from 'antd';
import type { SliderMarks } from 'antd/lib/slider';
import type { SliderMarks } from 'antd/es/slider';
import React from 'react';
const style: React.CSSProperties = {

View File

@ -15,7 +15,7 @@ Countdown component.
```tsx
import { Col, Row, Statistic } from 'antd';
import type { countdownValueType } from 'antd/lib/statistic/utils';
import type { countdownValueType } from 'antd/es/statistic/utils';
import React from 'react';
const { Countdown } = Statistic;

View File

@ -27,8 +27,8 @@ Setting `rowSelection.preserveSelectedRowKeys` to keep the `key` when enable sel
```tsx
import { Table } from 'antd';
import type { ColumnsType, TablePaginationConfig } from 'antd/lib/table';
import type { FilterValue, SorterResult } from 'antd/lib/table/interface';
import type { ColumnsType, TablePaginationConfig } from 'antd/es/table';
import type { FilterValue, SorterResult } from 'antd/es/table/interface';
import qs from 'qs';
import React, { useEffect, useState } from 'react';

View File

@ -15,7 +15,7 @@ Simple table with actions.
```tsx
import { Space, Table, Tag } from 'antd';
import type { ColumnsType } from 'antd/lib/table';
import type { ColumnsType } from 'antd/es/table';
import React from 'react';
interface DataType {

View File

@ -15,7 +15,7 @@ Add border, title and footer for table.
```tsx
import { Table } from 'antd';
import type { ColumnsType } from 'antd/lib/table';
import type { ColumnsType } from 'antd/es/table';
import React from 'react';
interface DataType {

View File

@ -20,7 +20,7 @@ Table cell supports `colSpan` and `rowSpan` that set in render return object. Wh
```tsx
import { Table } from 'antd';
import type { ColumnsType } from 'antd/lib/table';
import type { ColumnsType } from 'antd/es/table';
import React from 'react';
interface DataType {

View File

@ -21,8 +21,8 @@ Add the `boolean` type parameter `closeDropdown` to the function `clearFilters`.
import { SearchOutlined } from '@ant-design/icons';
import type { InputRef } from 'antd';
import { Button, Input, Space, Table } from 'antd';
import type { ColumnsType, ColumnType } from 'antd/lib/table';
import type { FilterConfirmProps } from 'antd/lib/table/interface';
import type { ColumnsType, ColumnType } from 'antd/es/table';
import type { FilterConfirmProps } from 'antd/es/table/interface';
import React, { useRef, useState } from 'react';
import Highlighter from 'react-highlight-words';

View File

@ -16,7 +16,7 @@ Alternatively you can implement drag sorting with handler using [react-sortable-
```tsx
import { MenuOutlined } from '@ant-design/icons';
import { Table } from 'antd';
import type { ColumnsType } from 'antd/lib/table';
import type { ColumnsType } from 'antd/es/table';
import { arrayMoveImmutable } from 'array-move';
import React, { useState } from 'react';
import type { SortableContainerProps, SortEnd } from 'react-sortable-hoc';

View File

@ -15,7 +15,7 @@ By using `components`, we can integrate table with [react-dnd](https://github.co
```tsx
import { Table } from 'antd';
import type { ColumnsType } from 'antd/lib/table';
import type { ColumnsType } from 'antd/es/table';
import update from 'immutability-helper';
import React, { useCallback, useRef, useState } from 'react';
import { DndProvider, useDrag, useDrop } from 'react-dnd';

View File

@ -17,9 +17,9 @@ Select different settings to see the result.
import { DownOutlined } from '@ant-design/icons';
import type { RadioChangeEvent } from 'antd';
import { Form, Radio, Space, Switch, Table } from 'antd';
import type { SizeType } from 'antd/lib/config-provider/SizeContext';
import type { ColumnsType, TableProps } from 'antd/lib/table';
import type { ExpandableConfig, TableRowSelection } from 'antd/lib/table/interface';
import type { SizeType } from 'antd/es/config-provider/SizeContext';
import type { ColumnsType, TableProps } from 'antd/es/table';
import type { ExpandableConfig, TableRowSelection } from 'antd/es/table/interface';
import React, { useState } from 'react';
interface DataType {

View File

@ -16,7 +16,7 @@ Table with editable cells. When work with `shouldCellUpdate`, please take care o
```tsx
import type { InputRef } from 'antd';
import { Button, Form, Input, Popconfirm, Table } from 'antd';
import type { FormInstance } from 'antd/lib/form';
import type { FormInstance } from 'antd/es/form';
import React, { useContext, useEffect, useRef, useState } from 'react';
const EditableContext = React.createContext<FormInstance<any> | null>(null);

View File

@ -15,7 +15,7 @@ Ellipsis cell content via setting `column.ellipsis.showTitle`, use `Tooltip` ins
```tsx
import { Table, Tooltip } from 'antd';
import type { ColumnsType } from 'antd/lib/table';
import type { ColumnsType } from 'antd/es/table';
import React from 'react';
interface DataType {

View File

@ -19,7 +19,7 @@ Ellipsis cell content via setting `column.ellipsis`.
```tsx
import { Table } from 'antd';
import type { ColumnsType } from 'antd/lib/table';
import type { ColumnsType } from 'antd/es/table';
import React from 'react';
interface DataType {

View File

@ -15,7 +15,7 @@ When there's too much information to show and the table can't display all at onc
```tsx
import { Table } from 'antd';
import type { ColumnsType } from 'antd/lib/table';
import type { ColumnsType } from 'antd/es/table';
import React from 'react';
interface DataType {

View File

@ -18,7 +18,7 @@ You can use `filterMode` to change default filter interface, options: `menu`(def
```tsx
import { Table } from 'antd';
import type { ColumnsType, TableProps } from 'antd/lib/table';
import type { ColumnsType, TableProps } from 'antd/es/table';
import React from 'react';
interface DataType {

View File

@ -16,7 +16,7 @@ title:
```tsx
import { Table } from 'antd';
import type { ColumnsType, TableProps } from 'antd/lib/table';
import type { ColumnsType, TableProps } from 'antd/es/table';
import React from 'react';
interface DataType {

View File

@ -23,7 +23,7 @@ A Solution for displaying large amounts of data with long columns.
```tsx
import { Table } from 'antd';
import type { ColumnsType } from 'antd/lib/table';
import type { ColumnsType } from 'antd/es/table';
import React from 'react';
interface DataType {

View File

@ -27,7 +27,7 @@ To fix some columns and scroll inside other columns, and you must set `scroll.x`
```tsx
import { Table } from 'antd';
import type { ColumnsType } from 'antd/lib/table';
import type { ColumnsType } from 'antd/es/table';
import React from 'react';
interface DataType {

View File

@ -19,7 +19,7 @@ Display large amounts of data in scrollable view.
```tsx
import { Table } from 'antd';
import type { ColumnsType } from 'antd/lib/table';
import type { ColumnsType } from 'antd/es/table';
import React from 'react';
interface DataType {

View File

@ -15,7 +15,7 @@ Group table head with `columns[n].children`.
```tsx
import { Table } from 'antd';
import type { ColumnsType } from 'antd/lib/table';
import type { ColumnsType } from 'antd/es/table';
import React from 'react';
interface DataType {

View File

@ -31,7 +31,7 @@ If a `sortOrder` or `defaultSortOrder` is specified with the value `ascend` or `
```tsx
import { Table } from 'antd';
import type { ColumnsType, TableProps } from 'antd/lib/table';
import type { ColumnsType, TableProps } from 'antd/es/table';
import React from 'react';
interface DataType {

View File

@ -15,7 +15,7 @@ title:
```tsx
import { Table } from 'antd';
import type { ColumnsType, TableProps } from 'antd/lib/table';
import type { ColumnsType, TableProps } from 'antd/es/table';
import React from 'react';
interface DataType {

View File

@ -16,7 +16,7 @@ There are two compacted table sizes: `middle` and `small`. The `small` size is u
```tsx
import { Table } from 'antd';
import type { ColumnsType } from 'antd/lib/table';
import type { ColumnsType } from 'antd/es/table';
import React from 'react';
interface DataType {

View File

@ -16,7 +16,7 @@ You can control the order of the expand and select columns by using `Table.EXPAN
```tsx
import { Table } from 'antd';
import type { ColumnsType } from 'antd/lib/table';
import type { ColumnsType } from 'antd/es/table';
import React from 'react';
interface DataType {

View File

@ -15,7 +15,7 @@ Table pagination settings.
```tsx
import { Radio, Space, Table, Tag } from 'antd';
import type { ColumnsType } from 'antd/lib/table';
import type { ColumnsType } from 'antd/es/table';
import React, { useState } from 'react';
interface DataType {

View File

@ -24,7 +24,7 @@ Control filters and sorters by `filteredValue` and `sortOrder`.
```tsx
import type { TableProps } from 'antd';
import { Button, Space, Table } from 'antd';
import type { ColumnsType, FilterValue, SorterResult } from 'antd/lib/table/interface';
import type { ColumnsType, FilterValue, SorterResult } from 'antd/es/table/interface';
import React, { useState } from 'react';
interface DataType {

View File

@ -16,7 +16,7 @@ Implement resizable column by integrate with [react-resizable](https://github.co
```tsx
import { Table } from 'antd';
import type { ColumnsType, ColumnType } from 'antd/lib/table';
import type { ColumnsType, ColumnType } from 'antd/es/table';
import React, { useState } from 'react';
import type { ResizeCallbackData } from 'react-resizable';
import { Resizable } from 'react-resizable';

View File

@ -15,7 +15,7 @@ Responsive columns.
```tsx
import { Table } from 'antd';
import type { ColumnsType } from 'antd/lib/table';
import type { ColumnsType } from 'antd/es/table';
import React from 'react';
interface DataType {

View File

@ -15,7 +15,7 @@ To perform operations and clear selections after selecting some rows, use `rowSe
```tsx
import { Button, Table } from 'antd';
import type { ColumnsType } from 'antd/lib/table';
import type { ColumnsType } from 'antd/es/table';
import React, { useState } from 'react';
interface DataType {

View File

@ -16,8 +16,8 @@ Customize selection group.
```tsx
import { Table } from 'antd';
import type { ColumnsType } from 'antd/lib/table';
import type { TableRowSelection } from 'antd/lib/table/interface';
import type { ColumnsType } from 'antd/es/table';
import type { TableRowSelection } from 'antd/es/table/interface';
import React from 'react';
interface DataType {

View File

@ -15,8 +15,8 @@ Use `rowSelection.selections` custom selections, default no select dropdown, sho
```tsx
import { Table } from 'antd';
import type { ColumnsType } from 'antd/lib/table';
import type { TableRowSelection } from 'antd/lib/table/interface';
import type { ColumnsType } from 'antd/es/table';
import type { TableRowSelection } from 'antd/es/table/interface';
import React, { useState } from 'react';
interface DataType {

View File

@ -19,7 +19,7 @@ Rows can be selectable by making first column as a selectable column. You can us
```tsx
import { Divider, Radio, Table } from 'antd';
import type { ColumnsType } from 'antd/lib/table';
import type { ColumnsType } from 'antd/es/table';
import React, { useState } from 'react';
interface DataType {

View File

@ -15,7 +15,7 @@ There are two compacted table sizes: `middle` and `small`. The `small` size is u
```tsx
import { Table } from 'antd';
import type { ColumnsType } from 'antd/lib/table';
import type { ColumnsType } from 'antd/es/table';
import React from 'react';
interface DataType {

View File

@ -15,7 +15,7 @@ For long tableneed to scroll to view the header and scroll barthen you can
```tsx
import { Switch, Table } from 'antd';
import type { ColumnsType } from 'antd/lib/table';
import type { ColumnsType } from 'antd/es/table';
import React, { useState } from 'react';
interface DataType {

View File

@ -15,7 +15,7 @@ Set summary content by `summary` prop. Sync column fixed status with `Table.Summ
```tsx
import { Table, Typography } from 'antd';
import type { ColumnsType } from 'antd/lib/table';
import type { ColumnsType } from 'antd/es/table';
import React from 'react';
const { Text } = Typography;

View File

@ -19,8 +19,8 @@ You can control the indent width by setting `indentSize`.
```tsx
import { Space, Switch, Table } from 'antd';
import type { ColumnsType } from 'antd/lib/table';
import type { TableRowSelection } from 'antd/lib/table/interface';
import type { ColumnsType } from 'antd/es/table';
import type { TableRowSelection } from 'antd/es/table/interface';
import React, { useState } from 'react';
interface DataType {

View File

@ -16,7 +16,7 @@ Large size tabs are usually used in page header, and small size could be used in
```tsx
import type { RadioChangeEvent } from 'antd';
import { Radio, Tabs } from 'antd';
import type { SizeType } from 'antd/lib/config-provider/SizeContext';
import type { SizeType } from 'antd/es/config-provider/SizeContext';
import React, { useState } from 'react';
const { TabPane } = Tabs;

View File

@ -15,7 +15,7 @@ Controlled mode lets parent nodes reflect the status of child nodes more intelli
```tsx
import { Tree } from 'antd';
import type { DataNode } from 'antd/lib/tree';
import type { DataNode } from 'antd/es/tree';
import React, { useState } from 'react';
const treeData: DataNode[] = [

View File

@ -15,7 +15,7 @@ The most basic usage, tell you how to use checkable, selectable, disabled, defau
```tsx
import { Tree } from 'antd';
import type { DataNode, TreeProps } from 'antd/lib/tree';
import type { DataNode, TreeProps } from 'antd/es/tree';
import React from 'react';
const treeData: DataNode[] = [

View File

@ -16,7 +16,7 @@ Plenty of tree nodes.
```tsx
import { Tree } from 'antd';
import type { DataNode } from 'antd/lib/tree';
import type { DataNode } from 'antd/es/tree';
import React from 'react';
const treeData: DataNode[] = [];

View File

@ -22,7 +22,7 @@ import {
SmileOutlined,
} from '@ant-design/icons';
import { Tree } from 'antd';
import type { DataNode } from 'antd/lib/tree';
import type { DataNode } from 'antd/es/tree';
import React from 'react';
const treeData: DataNode[] = [

View File

@ -15,7 +15,7 @@ Built-in directory tree. `multiple` support `ctrl(Windows)` / `command(Mac)` sel
```tsx
import { Tree } from 'antd';
import type { DataNode, DirectoryTreeProps } from 'antd/lib/tree';
import type { DataNode, DirectoryTreeProps } from 'antd/es/tree';
import React from 'react';
const { DirectoryTree } = Tree;

View File

@ -15,7 +15,7 @@ Drag treeNode to insert after the other treeNode or insert into the other parent
```tsx
import { Tree } from 'antd';
import type { DataNode, TreeProps } from 'antd/lib/tree';
import type { DataNode, TreeProps } from 'antd/es/tree';
import React, { useState } from 'react';
const x = 3;

View File

@ -16,7 +16,7 @@ Tree with connected line between nodes, turn on by `showLine`, customize the pre
```tsx
import { CarryOutOutlined, FormOutlined } from '@ant-design/icons';
import { Switch, Tree } from 'antd';
import type { DataNode } from 'antd/lib/tree';
import type { DataNode } from 'antd/es/tree';
import React, { useState } from 'react';
const treeData: DataNode[] = [

View File

@ -15,7 +15,7 @@ Searchable Tree.
```tsx
import { Input, Tree } from 'antd';
import type { DataNode } from 'antd/lib/tree';
import type { DataNode } from 'antd/es/tree';
import React, { useMemo, useState } from 'react';
const { Search } = Input;

View File

@ -16,7 +16,7 @@ customize collapse/expand icon of tree node
```tsx
import { DownOutlined } from '@ant-design/icons';
import { Tree } from 'antd';
import type { DataNode, TreeProps } from 'antd/lib/tree';
import type { DataNode, TreeProps } from 'antd/es/tree';
import React from 'react';
const treeData: DataNode[] = [

View File

@ -15,7 +15,7 @@ Use virtual list through `height` prop.
```tsx
import { Tree } from 'antd';
import type { DataNode } from 'antd/lib/tree';
import type { DataNode } from 'antd/es/tree';
import React from 'react';
const dig = (path = '0', level = 3) => {

View File

@ -98,7 +98,7 @@ Follow [Use in create-react-app](/docs/react/use-with-create-react-app).
Another approach to customize theme is creating a `less` file within variables to override `antd.less`.
```css
@import '~antd/lib/style/themes/default.less';
@import '~antd/es/style/themes/default.less';
@import '~antd/dist/antd.less'; // Import Ant Design styles by less entry
@import 'your-theme-file.less'; // variables to override above
```
@ -122,7 +122,7 @@ It's possible to configure webpack to load an alternate less file:
```ts
new webpack.NormalModuleReplacementPlugin( /node_modules\/antd\/lib\/style\/index\.less/, path.resolve(rootDir, 'src/myStylesReplacement.less') )
#antd { @import '~antd/lib/style/core/index.less'; @import '~antd/lib/style/themes/default.less'; }
#antd { @import '~antd/es/style/core/index.less'; @import '~antd/es/style/themes/default.less'; }
```
Where the src/myStylesReplacement.less file loads the same files as the index.less file, but loads them within the scope of a top-level selector : the result is that all of the "global" styles are being applied with the #antd scope.

View File

@ -98,7 +98,7 @@ module.exports = {
另外一种方式是建立一个单独的 `less` 变量文件,引入这个文件覆盖 `antd.less` 里的变量。
```css
@import '~antd/lib/style/themes/default.less';
@import '~antd/es/style/themes/default.less';
@import '~antd/dist/antd.less'; // 引入官方提供的 less 样式入口文件
@import 'your-theme-file.less'; // 用于覆盖上面定义的变量
```

View File

@ -34,7 +34,7 @@ import React, { useState } from 'react';
import { render } from 'react-dom';
import { ConfigProvider, DatePicker, message } from 'antd';
// 由于 antd 组件的默认文案是英文,所以需要修改为中文
import zhCN from 'antd/lib/locale/zh_CN';
import zhCN from 'antd/es/locale/zh_CN';
import moment from 'moment';
import 'moment/locale/zh-cn';
import 'antd/dist/antd.css';

View File

@ -11,7 +11,7 @@ The default language of `antd@2.x` is currently English. If you wish to use othe
```jsx
import { ConfigProvider } from 'antd';
import frFR from 'antd/lib/locale/fr_FR';
import frFR from 'antd/es/locale/fr_FR';
return (
<ConfigProvider locale={frFR}>

View File

@ -10,7 +10,7 @@ title: 国际化
antd 提供了一个 React 组件 [ConfigProvider](/components/config-provider) 用于全局配置国际化文案。
```jsx
import zhCN from 'antd/lib/locale/zh_CN';
import zhCN from 'antd/es/locale/zh_CN';
return (
<ConfigProvider locale={zhCN}>

View File

@ -59,7 +59,7 @@ We provide Less and JavaScript usage for developers.
- **Less**
```less
@import '~antd/lib/style/themes/default.less';
@import '~antd/es/style/themes/default.less';
.selector {
color: @blue-5;

View File

@ -67,7 +67,7 @@ ReactDOM.render(<ColorPaletteTool />, mountNode);
- **Less**
```less
@import '~antd/lib/style/themes/default.less';
@import '~antd/es/style/themes/default.less';
.selector {
color: @blue-5;