Compare commits
2 Commits
ba97fbca46
...
96690a1063
Author | SHA1 | Date |
---|---|---|
ln1778 | 96690a1063 | |
ln1778 | 401608de32 |
|
@ -60,7 +60,7 @@
|
||||||
</li>
|
</li>
|
||||||
</ul>
|
</ul>
|
||||||
</div>
|
</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">
|
<el-dialog :visible.sync="dialogVisible">
|
||||||
<img width="100%" :src="dialogImageUrl" alt="">
|
<img width="100%" :src="dialogImageUrl" alt="">
|
||||||
</el-dialog>
|
</el-dialog>
|
||||||
|
@ -235,8 +235,12 @@
|
||||||
raw:item
|
raw:item
|
||||||
});
|
});
|
||||||
if(files.length==uplist.length){
|
if(files.length==uplist.length){
|
||||||
this.imageList.push(...uplist);
|
if(this.$listeners.onUpload){
|
||||||
this.$emit('onUpload',uplist,this.imageList);
|
this.fileList.push(...uplist);
|
||||||
|
this.$emit('onUpload',uplist,this.fileList);
|
||||||
|
}else{
|
||||||
|
this.imageList.push(...uplist);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}.bind(this);
|
}.bind(this);
|
||||||
filerender.readAsDataURL(item);
|
filerender.readAsDataURL(item);
|
||||||
|
|
12
src/App.vue
12
src/App.vue
|
@ -47,8 +47,7 @@
|
||||||
<div>{{row.date}} </div>
|
<div>{{row.date}} </div>
|
||||||
</template>
|
</template>
|
||||||
</agTable>
|
</agTable>
|
||||||
<agUpdate @onUpload="onUpload" multiple isDrap :limit="5" @onError="onError" listType="picture" :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">
|
||||||
<el-button type="primary" size="small">点击上传</el-button>
|
|
||||||
<div slot="tip">只能上传jpg/png文件,且不超过500kb</div>
|
<div slot="tip">只能上传jpg/png文件,且不超过500kb</div>
|
||||||
</agUpdate>
|
</agUpdate>
|
||||||
<!-- <el-input
|
<!-- <el-input
|
||||||
|
@ -368,15 +367,18 @@ export default {
|
||||||
handleChange: () => {},
|
handleChange: () => {},
|
||||||
},
|
},
|
||||||
],
|
],
|
||||||
};
|
filelist:['https://git.aiguoai.com/assets/img/logo.svg']
|
||||||
|
}
|
||||||
},
|
},
|
||||||
|
|
||||||
mounted(){
|
mounted(){
|
||||||
this.$refs.aginputref.value=123;
|
this.$refs.aginputref.value=123;
|
||||||
},
|
},
|
||||||
methods: {
|
methods: {
|
||||||
onUpload(files,filelist){
|
onUpload(files,list){
|
||||||
console.log("onUpload",files,filelist);
|
console.log("onUpload",files,list);
|
||||||
|
this.filelist=list;
|
||||||
|
|
||||||
},
|
},
|
||||||
onError(err){
|
onError(err){
|
||||||
console.log("onError",err);
|
console.log("onError",err);
|
||||||
|
|
Loading…
Reference in New Issue