diff --git a/src/components/scUpload/multiple.vue b/src/components/scUpload/multiple.vue
index 265138e5..9c860194 100644
--- a/src/components/scUpload/multiple.vue
+++ b/src/components/scUpload/multiple.vue
@@ -8,7 +8,7 @@
@@ -17,7 +17,7 @@
-
+
点击上传
@@ -33,35 +33,39 @@
},
data(){
return {
+ defaultList: this.toArr(this.modelValue),
fileList: []
}
},
watch:{
- // modelValue(){
- // this.fileList = this.toArr(this.modelValue);
- // },
- // fileList: {
- // handler(){
- // this.$emit('update:modelValue', this.toStr(this.fileList));
- // },
- // deep: true
- // }
+ modelValue(){
+
+ },
+ fileList: {
+ handler(val){
+ this.$emit('update:modelValue', this.toStr(val));
+ },
+ deep: true
+ }
},
mounted() {
- this.fileList = this.toArr(this.modelValue);
- this.$refs.upload.uploadFiles = this.fileList
+ this.fileList = this.$refs.upload.uploadFiles
+
},
methods: {
+
//默认值转换为数组
toArr(str){
var _arr = [];
var arr = str.split(",");
arr.forEach(item => {
- _arr.push({
- name: "F",
- status: "success",
- url: item
- })
+ if(item){
+ _arr.push({
+ name: "F",
+ status: "success",
+ url: item
+ })
+ }
})
return _arr;
},
@@ -75,15 +79,13 @@
return str;
},
before(){
- this.fileList = this.$refs.upload.uploadFiles;
- this.fileList.forEach(item => {
- if(item.status!='success'){
- item.tempURL = URL.createObjectURL(item.raw);
- }
- })
+ console.log(this.$refs.upload.uploadFiles);
},
success(res, file){
file.url = res.data.src
+ },
+ remove(){
+
},
error(err){
this.$notify.error({
diff --git a/src/views/vab/upload.vue b/src/views/vab/upload.vue
index 88391013..e9ed0d04 100644
--- a/src/views/vab/upload.vue
+++ b/src/views/vab/upload.vue
@@ -52,7 +52,7 @@
uploadUrl: this.$API.demo.upload.url,
imgurl: "images/avatar.jpg",
avatar: "",
- imgs: "images/avatar.jpg,images/avatar.jpg",
+ imgs: "images/avatar.jpg,images/avatar2.gif,images/avatar3.gif",
form: {
img1: "",
img2: "",