Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
N
najiu-admin-template
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
najiu-frontend
najiu-admin-template
Commits
fb5395b5
Commit
fb5395b5
authored
Dec 07, 2020
by
vben
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fix(upload): fix file upload key loss #120
parent
88f4a3f0
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
17 additions
and
20 deletions
+17
-20
FileList.tsx
src/components/Upload/src/FileList.tsx
+17
-20
No files found.
src/components/Upload/src/FileList.tsx
View file @
fb5395b5
import
{
defineComponent
}
from
'
vue
'
;
import
{
defineComponent
,
CSSProperties
}
from
'
vue
'
;
import
{
fileListProps
}
from
'
./props
'
;
import
{
isFunction
}
from
'
/@/utils/is
'
;
import
'
./FileList.less
'
;
...
...
@@ -16,11 +16,13 @@ export default defineComponent({
<
colgroup
>
{
columnList
.
map
((
item
)
=>
{
const
{
width
=
0
,
dataIndex
}
=
item
;
return
width
?
(
<
col
style=
{
'
width:
'
+
width
+
'
px;min-width:
'
+
width
+
'
px;
'
}
key=
{
dataIndex
}
/>
)
:
(
<
col
/>
);
const
style
:
CSSProperties
=
{
width
:
`${width}px`
,
minWidth
:
`${width}px`
,
};
return
<
col
style=
{
width
?
style
:
{}
}
key=
{
dataIndex
}
/>;
})
}
</
colgroup
>
<
thead
>
...
...
@@ -38,22 +40,17 @@ export default defineComponent({
<
tbody
>
{
dataSource
.
map
((
record
=
{})
=>
{
return
(
<
tr
class=
"file-table-tr"
>
<
tr
class=
"file-table-tr"
key=
{
record
.
uuid
}
>
{
columnList
.
map
((
item
)
=>
{
const
{
dataIndex
=
''
,
customRender
,
align
=
'
center
'
}
=
item
;
if
(
customRender
&&
isFunction
(
customRender
))
{
return
(
<
td
class=
{
[
'
file-table-td
'
,
align
]
}
key=
{
dataIndex
}
>
{
customRender
({
text
:
record
[
dataIndex
],
record
})
}
</
td
>
);
}
else
{
return
(
<
td
class=
{
[
'
file-table-td
'
,
align
]
}
key=
{
dataIndex
}
>
{
record
[
dataIndex
]
}
</
td
>
);
}
const
render
=
customRender
&&
isFunction
(
customRender
);
return
(
<
td
class=
{
[
'
file-table-td
'
,
align
]
}
key=
{
dataIndex
}
>
{
render
?
customRender
?.({
text
:
record
[
dataIndex
],
record
})
:
record
[
dataIndex
]
}
</
td
>
);
})
}
</
tr
>
);
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment