demo(table): use TableColumnsType instead of ColumnsType] (#49787)

This commit is contained in:
thinkasany 2024-07-09 17:35:10 +08:00 committed by GitHub
parent ce1721b169
commit 80a71b14f4
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 8 additions and 8 deletions

View File

@ -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' },

View File

@ -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',

View File

@ -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',

View File

@ -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',