Skip to content

Commit

Permalink
fix: default key
Browse files Browse the repository at this point in the history
  • Loading branch information
Alex-huxiyang committed Nov 4, 2024
1 parent d59de4c commit d902a65
Show file tree
Hide file tree
Showing 6 changed files with 16 additions and 2 deletions.
1 change: 1 addition & 0 deletions src/packages/uploader/demos/h5/demo1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ const Demo1 = () => {
const [list, setList] = useState<FileItem[]>([
{
url: 'https://m.360buyimg.com/babel/jfs/t1/164410/22/25162/93384/616eac6cE6c711350/0cac53c1b82e1b05.gif',
uid: 133,
},
])

Expand Down
6 changes: 6 additions & 0 deletions src/packages/uploader/demos/h5/demo2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: <Star style={{ color: 'white' }} />,
},
{
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: '上传中...',
Expand Down
1 change: 1 addition & 0 deletions src/packages/uploader/demos/taro/demo1.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@ const Demo1 = () => {
const [list, setList] = useState<FileItem[]>([
{
url: demoUrl,
uid: 133,
},
])

Expand Down
6 changes: 6 additions & 0 deletions src/packages/uploader/demos/taro/demo2.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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: <Star style={{ color: 'white' }} />,
},
{
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: '上传中...',
Expand Down
2 changes: 1 addition & 1 deletion src/packages/uploader/preview.taro.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ export const Preview: React.FunctionComponent<any> = ({
fileList.map((item: FileItem, index: number) => {
const {
status = 'success',
uid,
uid = index,
url,
message = '',
name = '',
Expand Down
2 changes: 1 addition & 1 deletion src/packages/uploader/preview.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ export const Preview: React.FunctionComponent<any> = ({
fileList.map((item: FileItem, index: number) => {
const {
status = 'success',
uid,
uid = index,
url,
message = '',
name = '',
Expand Down

0 comments on commit d902a65

Please sign in to comment.