This repository was archived by the owner on May 12, 2021. It is now read-only.
File tree Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Expand file tree Collapse file tree 3 files changed +10
-3
lines changed Original file line number Diff line number Diff line change 10
10
:isShowSize =" true"
11
11
:isShowTip =" true"
12
12
:limit =" 6"
13
- :multiple =" false "
13
+ :multiple =" true "
14
14
:responseFn =" handleResponse"
15
15
action =" https://jsonplaceholder.typicode.com/posts/"
16
16
placeholder =" 上传附件"
Original file line number Diff line number Diff line change @@ -156,11 +156,18 @@ export default {
156
156
},
157
157
// 列表
158
158
list () {
159
+ let temp = 1
159
160
if (this .value ) {
160
161
// 首先将值转为数组
161
162
const list = Array .isArray (this .value ) ? this .value : [this .value ]
162
163
// 然后将数组转为对象数组
163
- return list .map ((item ) => typeof item === ' string' ? { name: item, url: item } : item)
164
+ return list .map ((item ) => {
165
+ if (typeof item === ' string' ) {
166
+ item = { name: item, url: item }
167
+ }
168
+ item .uid = item .uid || new Date () + temp++
169
+ return item
170
+ })
164
171
} else {
165
172
return []
166
173
}
Original file line number Diff line number Diff line change 1
1
{
2
2
"name" : " vue-ele-upload-file" ,
3
3
"description" : " 对 element-ui upload 组件进一步封装, 使其更简单、易用" ,
4
- "version" : " 0.0.1 " ,
4
+ "version" : " 0.0.2 " ,
5
5
"private" : false ,
6
6
"license" : " MIT" ,
7
7
"scripts" : {
You can’t perform that action at this time.
0 commit comments