liunan #10
|
@ -60,7 +60,7 @@
|
|||
</li>
|
||||
</ul>
|
||||
</div>
|
||||
<input type="file" style="display:none;" :multiple="limit>1" :accept="$attrs.accept" id="uploadinput" @change="onUpdate" ref="fileinputref"/>
|
||||
<input type="file" style="display:none;" :multiple="limit>1&&$attrs.multiple" :accept="$attrs.accept" id="uploadinput" @change="onUpdate" ref="fileinputref"/>
|
||||
<el-dialog :visible.sync="dialogVisible">
|
||||
<img width="100%" :src="dialogImageUrl" alt="">
|
||||
</el-dialog>
|
||||
|
@ -235,8 +235,12 @@
|
|||
raw:item
|
||||
});
|
||||
if(files.length==uplist.length){
|
||||
this.imageList.push(...uplist);
|
||||
this.$emit('onUpload',uplist,this.imageList);
|
||||
if(this.$listeners.onUpload){
|
||||
this.fileList.push(...uplist);
|
||||
this.$emit('onUpload',uplist,this.fileList);
|
||||
}else{
|
||||
this.imageList.push(...uplist);
|
||||
}
|
||||
}
|
||||
}.bind(this);
|
||||
filerender.readAsDataURL(item);
|
||||
|
|
11
src/App.vue
11
src/App.vue
|
@ -47,7 +47,7 @@
|
|||
<div>{{row.date}} </div>
|
||||
</template>
|
||||
</agTable>
|
||||
<agUpdate @onUpload="onUpload" multiple isDrap :limit="5" @onError="onError" :maxSize="1024*1024" :fileList="['https://git.aiguoai.com/assets/img/logo.svg']">
|
||||
<agUpdate @onUpload="onUpload" isDrap dragmove multiple :limit="5" @onError="onError" :maxSize="1024*1024" :fileList="filelist">
|
||||
<div slot="tip">只能上传jpg/png文件,且不超过500kb</div>
|
||||
</agUpdate>
|
||||
<!-- <el-input
|
||||
|
@ -367,15 +367,18 @@ export default {
|
|||
handleChange: () => {},
|
||||
},
|
||||
],
|
||||
};
|
||||
filelist:['https://git.aiguoai.com/assets/img/logo.svg']
|
||||
}
|
||||
},
|
||||
|
||||
mounted(){
|
||||
this.$refs.aginputref.value=123;
|
||||
},
|
||||
methods: {
|
||||
onUpload(files,filelist){
|
||||
console.log("onUpload",files,filelist);
|
||||
onUpload(files,list){
|
||||
console.log("onUpload",files,list);
|
||||
this.filelist=list;
|
||||
|
||||
},
|
||||
onError(err){
|
||||
console.log("onError",err);
|
||||
|
|
Loading…
Reference in New Issue