格式化ImageUpload组件中的对象字面量
parent
a16f39473d
commit
bc62c2f8e5
|
@ -92,7 +92,7 @@ export default {
|
||||||
// 然后将数组转为对象数组
|
// 然后将数组转为对象数组
|
||||||
this.fileList = list.map(item => {
|
this.fileList = list.map(item => {
|
||||||
if (typeof item === "string") {
|
if (typeof item === "string") {
|
||||||
item = { name: item, url: item };
|
item = {name: item, url: item};
|
||||||
}
|
}
|
||||||
return item;
|
return item;
|
||||||
});
|
});
|
||||||
|
@ -150,7 +150,7 @@ export default {
|
||||||
// 上传成功回调
|
// 上传成功回调
|
||||||
handleUploadSuccess(res, file) {
|
handleUploadSuccess(res, file) {
|
||||||
if (res.code === 200) {
|
if (res.code === 200) {
|
||||||
this.uploadList.push({ name: res.data.url, url: res.data.url });
|
this.uploadList.push({name: res.data.url, url: res.data.url});
|
||||||
this.uploadedSuccessfully();
|
this.uploadedSuccessfully();
|
||||||
} else {
|
} else {
|
||||||
this.number--;
|
this.number--;
|
||||||
|
@ -207,6 +207,7 @@ export default {
|
||||||
::v-deep.hide .el-upload--picture-card {
|
::v-deep.hide .el-upload--picture-card {
|
||||||
display: none;
|
display: none;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 去掉动画效果
|
// 去掉动画效果
|
||||||
::v-deep .el-list-enter-active,
|
::v-deep .el-list-enter-active,
|
||||||
::v-deep .el-list-leave-active {
|
::v-deep .el-list-leave-active {
|
||||||
|
|
Loading…
Reference in New Issue