mirror of
https://github.com/ant-design/ant-design.git
synced 2025-01-18 14:13:37 +08:00
demo(table): use TableColumnsType instead of ColumnsType] (#49787)
This commit is contained in:
parent
ce1721b169
commit
80a71b14f4
@ -12,7 +12,7 @@ import {
|
||||
} from '@dnd-kit/sortable';
|
||||
import { CSS } from '@dnd-kit/utilities';
|
||||
import { Button, Table } from 'antd';
|
||||
import type { ColumnsType } from 'antd/es/table';
|
||||
import type { TableColumnsType } from 'antd';
|
||||
|
||||
interface DataType {
|
||||
key: string;
|
||||
@ -42,7 +42,7 @@ const DragHandle: React.FC = () => {
|
||||
);
|
||||
};
|
||||
|
||||
const columns: ColumnsType<DataType> = [
|
||||
const columns: TableColumnsType<DataType> = [
|
||||
{ key: 'sort', align: 'center', width: 80, render: () => <DragHandle /> },
|
||||
{ title: 'Name', dataIndex: 'name' },
|
||||
{ title: 'Age', dataIndex: 'age' },
|
||||
|
@ -10,7 +10,7 @@ import {
|
||||
} from '@dnd-kit/sortable';
|
||||
import { CSS } from '@dnd-kit/utilities';
|
||||
import { Table } from 'antd';
|
||||
import type { ColumnsType } from 'antd/es/table';
|
||||
import type { TableColumnsType } from 'antd';
|
||||
|
||||
interface DataType {
|
||||
key: string;
|
||||
@ -19,7 +19,7 @@ interface DataType {
|
||||
address: string;
|
||||
}
|
||||
|
||||
const columns: ColumnsType<DataType> = [
|
||||
const columns: TableColumnsType<DataType> = [
|
||||
{
|
||||
title: 'Name',
|
||||
dataIndex: 'name',
|
||||
|
@ -304,14 +304,14 @@ Properties for row selection.
|
||||
```tsx
|
||||
import React from 'react';
|
||||
import { Table } from 'antd';
|
||||
import type { ColumnsType } from 'antd/es/table';
|
||||
import type { TableColumnsType } from 'antd';
|
||||
|
||||
interface User {
|
||||
key: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
const columns: ColumnsType<User> = [
|
||||
const columns: TableColumnsType<User> = [
|
||||
{
|
||||
key: 'name',
|
||||
title: 'Name',
|
||||
|
@ -306,14 +306,14 @@ const columns = [
|
||||
```tsx
|
||||
import React from 'react';
|
||||
import { Table } from 'antd';
|
||||
import type { ColumnsType } from 'antd/es/table';
|
||||
import type { TableColumnsType } from 'antd';
|
||||
|
||||
interface User {
|
||||
key: number;
|
||||
name: string;
|
||||
}
|
||||
|
||||
const columns: ColumnsType<User> = [
|
||||
const columns: TableColumnsType<User> = [
|
||||
{
|
||||
key: 'name',
|
||||
title: 'Name',
|
||||
|
Loading…
Reference in New Issue
Block a user