上传组件增加可选择上传途径

This commit is contained in:
aixianling
2022-03-15 10:25:48 +08:00
parent 52ec1ebe41
commit ec803816c9

View File

@@ -55,6 +55,7 @@ export default {
preview: Boolean,
size: {default: 10 * 1024 * 1024},
disabled: Boolean,
sourceType: {default: () => ['album', 'camera']}
},
computed: {
...mapState(['token']),
@@ -90,7 +91,7 @@ export default {
let params = {
count: this.limit,
sizeType: ['compressed'],
sourceType: ['album', 'camera'],
sourceType: [this.sourceType].flat(),
success: (res) => {
let count = this.fileList?.length + (res.tempFiles?.length || res.tempFile ? 1 : 0)
if (count > this.limit && this.limit !== 1) {