@xuekl/cli-components 1.5.6 → 1.5.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/XklUpload.vue +7 -0
- package/package.json +1 -1
package/XklUpload.vue
CHANGED
|
@@ -33,6 +33,13 @@ const actionUrl = http.adornUrl(config.url || '/common/upload')
|
|
|
33
33
|
const fileList = ref([])
|
|
34
34
|
|
|
35
35
|
const beforeUpload = (file) => {
|
|
36
|
+
if (config.accept) {
|
|
37
|
+
if (!file.type.includes(config.accept)) {
|
|
38
|
+
ElMessage.warning(config.acceptTip ? config.acceptTip : `文件类型不正确`)
|
|
39
|
+
return false
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
|
|
36
43
|
if (config.maxSize) {
|
|
37
44
|
if (file.size > config.maxSize * 1024 * 1024) {
|
|
38
45
|
ElMessage.warning(`文件大小不得超过${config.maxSize}M`)
|