diff --git a/src/packages/uploader/demos/h5/demo1.tsx b/src/packages/uploader/demos/h5/demo1.tsx index 78910105f..652b60351 100644 --- a/src/packages/uploader/demos/h5/demo1.tsx +++ b/src/packages/uploader/demos/h5/demo1.tsx @@ -7,6 +7,7 @@ const Demo1 = () => { const [list, setList] = useState([ { url: 'https://m.360buyimg.com/babel/jfs/t1/164410/22/25162/93384/616eac6cE6c711350/0cac53c1b82e1b05.gif', + uid: 133, }, ]) diff --git a/src/packages/uploader/demos/h5/demo2.tsx b/src/packages/uploader/demos/h5/demo2.tsx index 9982e3509..690f69d11 100644 --- a/src/packages/uploader/demos/h5/demo2.tsx +++ b/src/packages/uploader/demos/h5/demo2.tsx @@ -6,33 +6,39 @@ import { FileItem } from '../../file-item' const Demo2 = () => { const defaultList: FileItem[] = [ { + uid: 111, name: '文件文件文件文件1文件文件文件文件1文件文件文件文件1.png', url: 'https://m.360buyimg.com/babel/jfs/t1/164410/22/25162/93384/616eac6cE6c711350/0cac53c1b82e1b05.gif', status: 'success', message: '上传成功', }, { + uid: 222, name: '文件2.png', url: 'https://m.360buyimg.com/babel/jfs/t1/164410/22/25162/93384/616eac6cE6c711350/0cac53c1b82e1b05.gif', status: 'success', message: '上传成功', }, { + uid: 333, url: 'https://m.360buyimg.com/babel/jfs/t1/164410/22/25162/93384/616eac6cE6c711350/0cac53c1b82e1b05.gif', status: 'uploading', }, { + uid: 444, url: 'https://m.360buyimg.com/babel/jfs/t1/164410/22/25162/93384/616eac6cE6c711350/0cac53c1b82e1b05.gif', status: 'error', message: '上传失败', failIcon: , }, { + uid: 555, url: 'https://m.360buyimg.com/babel/jfs/t1/164410/22/25162/93384/616eac6cE6c711350/0cac53c1b82e1b05.gif', status: 'error', message: '上传失败', }, { + uid: 666, url: 'https://m.360buyimg.com/babel/jfs/t1/164410/22/25162/93384/616eac6cE6c711350/0cac53c1b82e1b05.gif', status: 'uploading', message: '上传中...', diff --git a/src/packages/uploader/demos/taro/demo1.tsx b/src/packages/uploader/demos/taro/demo1.tsx index f999aef32..5b60862b6 100644 --- a/src/packages/uploader/demos/taro/demo1.tsx +++ b/src/packages/uploader/demos/taro/demo1.tsx @@ -10,6 +10,7 @@ const Demo1 = () => { const [list, setList] = useState([ { url: demoUrl, + uid: 133, }, ]) diff --git a/src/packages/uploader/demos/taro/demo2.tsx b/src/packages/uploader/demos/taro/demo2.tsx index f910b3e76..7a3256280 100644 --- a/src/packages/uploader/demos/taro/demo2.tsx +++ b/src/packages/uploader/demos/taro/demo2.tsx @@ -6,33 +6,39 @@ import { FileItem } from '../../file-item' const Demo2 = () => { const defaultList: FileItem[] = [ { + uid: 111, name: '文件文件文件文件1文件文件文件文件1文件文件文件文件1.png', url: 'https://m.360buyimg.com/babel/jfs/t1/164410/22/25162/93384/616eac6cE6c711350/0cac53c1b82e1b05.gif', status: 'success', message: '上传成功', }, { + uid: 222, name: '文件2.png', url: 'https://m.360buyimg.com/babel/jfs/t1/164410/22/25162/93384/616eac6cE6c711350/0cac53c1b82e1b05.gif', status: 'success', message: '上传成功', }, { + uid: 333, url: 'https://m.360buyimg.com/babel/jfs/t1/164410/22/25162/93384/616eac6cE6c711350/0cac53c1b82e1b05.gif', status: 'uploading', }, { + uid: 444, url: 'https://m.360buyimg.com/babel/jfs/t1/164410/22/25162/93384/616eac6cE6c711350/0cac53c1b82e1b05.gif', status: 'error', message: '上传失败', failIcon: , }, { + uid: 555, url: 'https://m.360buyimg.com/babel/jfs/t1/164410/22/25162/93384/616eac6cE6c711350/0cac53c1b82e1b05.gif', status: 'error', message: '上传失败', }, { + uid: 666, url: 'https://m.360buyimg.com/babel/jfs/t1/164410/22/25162/93384/616eac6cE6c711350/0cac53c1b82e1b05.gif', status: 'uploading', message: '上传中...', diff --git a/src/packages/uploader/preview.taro.tsx b/src/packages/uploader/preview.taro.tsx index 43a8897b6..4d5c49121 100644 --- a/src/packages/uploader/preview.taro.tsx +++ b/src/packages/uploader/preview.taro.tsx @@ -33,7 +33,7 @@ export const Preview: React.FunctionComponent = ({ fileList.map((item: FileItem, index: number) => { const { status = 'success', - uid, + uid = index, url, message = '', name = '', diff --git a/src/packages/uploader/preview.tsx b/src/packages/uploader/preview.tsx index f94a9392d..177dcd88d 100644 --- a/src/packages/uploader/preview.tsx +++ b/src/packages/uploader/preview.tsx @@ -27,7 +27,7 @@ export const Preview: React.FunctionComponent = ({ fileList.map((item: FileItem, index: number) => { const { status = 'success', - uid, + uid = index, url, message = '', name = '',