v3.6.0 ImageUpload组件支持多图片上传

This commit is contained in:
YunaiV
2022-02-16 21:41:08 +08:00
parent 4f5964f287
commit bc400cf646
2 changed files with 163 additions and 52 deletions

View File

@ -163,13 +163,14 @@ export default {
return "";
}
},
// 对象转成分隔字符串
listToString(list) {
let files = "";
for (let key in list) {
files += list[key].url + ",";
// 对象转成指定字符串分隔
listToString(list, separator) {
let strs = "";
separator = separator || ",";
for (let i in list) {
strs += list[i].url + separator;
}
return files.substr(0, files.length - 1);
return strs != '' ? strs.substr(0, strs.length - 1) : '';
}
}
};