diff --git a/package/component/src/component/upload/index.vue b/package/component/src/component/upload/index.vue index b9d4fef9..abd47dad 100644 --- a/package/component/src/component/upload/index.vue +++ b/package/component/src/component/upload/index.vue @@ -17,7 +17,7 @@ import { ref, useSlots, withDefaults, - watch, + watch } from "vue"; import { templateRef } from "@vueuse/core"; import { LayLayer } from "@layui/layer-vue"; @@ -172,6 +172,7 @@ const slots = slot.default && slot.default(); const context = getCurrentInstance(); const emit = defineEmits([ "choose", + "chooseAfter", "before", "done", "error", @@ -193,8 +194,8 @@ const isDragEnter = ref(false); const activeUploadFiles = ref([]); const activeUploadFilesImgs = ref([]); const orgFileInput = templateRef("orgFileInput"); -let _cropper: any = null; +let _cropper: any = null; let computedCutLayerOption: ComputedRef; if (props.cutOptions && props.cutOptions.layerOption) { @@ -269,9 +270,8 @@ const errorF = (errorText: string) => { }; const localUpload = (option: localUploadOption, callback: Function) => { - let xhr: XMLHttpRequest, url; - xhr = new XMLHttpRequest(); - url = option.url; + let xhr: XMLHttpRequest = new XMLHttpRequest(); + let url = option.url; let formData = option.formData; const cb = callback; xhr.onreadystatechange = function () { @@ -352,6 +352,7 @@ const uploadChange = (e: any) => { props.cut && props.acceptMime.indexOf("image") != -1 && props.multiple == false; + let arm2 = props.cut && props.acceptMime.indexOf("image") != -1 && diff --git a/package/document-component/src/document/zh-CN/components/form.md b/package/document-component/src/document/zh-CN/components/form.md index 637b56bd..c06e2249 100644 --- a/package/document-component/src/document/zh-CN/components/form.md +++ b/package/document-component/src/document/zh-CN/components/form.md @@ -151,6 +151,7 @@ export default { ::: demo