mirror of
https://github.com/ant-design/ant-design.git
synced 2025-06-12 20:43:11 +08:00
type: fix drag sorting demo typos (#40697)
This commit is contained in:
parent
f646ba9c3a
commit
9632b36b04
@ -13,12 +13,12 @@ import { Button, Upload } from 'antd';
|
|||||||
import type { UploadFile, UploadProps } from 'antd/es/upload/interface';
|
import type { UploadFile, UploadProps } from 'antd/es/upload/interface';
|
||||||
import React, { useState } from 'react';
|
import React, { useState } from 'react';
|
||||||
|
|
||||||
interface DragableUploadListItemProps {
|
interface DraggableUploadListItemProps {
|
||||||
originNode: React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
originNode: React.ReactElement<any, string | React.JSXElementConstructor<any>>;
|
||||||
file: UploadFile<any>;
|
file: UploadFile<any>;
|
||||||
}
|
}
|
||||||
|
|
||||||
const DragableUploadListItem = ({ originNode, file }: DragableUploadListItemProps) => {
|
const DraggableUploadListItem = ({ originNode, file }: DraggableUploadListItemProps) => {
|
||||||
const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({
|
const { attributes, listeners, setNodeRef, transform, transition, isDragging } = useSortable({
|
||||||
id: file.uid,
|
id: file.uid,
|
||||||
});
|
});
|
||||||
@ -101,7 +101,7 @@ const App: React.FC = () => {
|
|||||||
fileList={fileList}
|
fileList={fileList}
|
||||||
onChange={onChange}
|
onChange={onChange}
|
||||||
itemRender={(originNode, file) => (
|
itemRender={(originNode, file) => (
|
||||||
<DragableUploadListItem originNode={originNode} file={file} />
|
<DraggableUploadListItem originNode={originNode} file={file} />
|
||||||
)}
|
)}
|
||||||
>
|
>
|
||||||
<Button icon={<UploadOutlined />}>Click to Upload</Button>
|
<Button icon={<UploadOutlined />}>Click to Upload</Button>
|
||||||
|
Loading…
Reference in New Issue
Block a user