@finema/core 1.4.84 → 1.4.85
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/dist/module.json
CHANGED
package/dist/module.mjs
CHANGED
|
@@ -94,6 +94,7 @@ import {
|
|
|
94
94
|
useUploadLoader,
|
|
95
95
|
useWatchTrue,
|
|
96
96
|
StringHelper,
|
|
97
|
+
_get,
|
|
97
98
|
} from '#imports'
|
|
98
99
|
import { uploadFileDropzone } from '#core/ui.config'
|
|
99
100
|
import i18next from 'i18next'
|
|
@@ -146,7 +147,7 @@ const onDrop = (files: File[] | null) => {
|
|
|
146
147
|
|
|
147
148
|
emits('change', file)
|
|
148
149
|
|
|
149
|
-
formData.append(props.bodyKey || 'file', file)
|
|
150
|
+
formData.append(_get(props, props.bodyKey || 'file'), file)
|
|
150
151
|
upload.run(formData, { data: { onUploadProgress, onDownloadProgress } })
|
|
151
152
|
}
|
|
152
153
|
}
|
|
@@ -228,7 +229,7 @@ const onDownloadProgress = (progressEvent: ProgressEvent) => {
|
|
|
228
229
|
useWatchTrue(
|
|
229
230
|
() => upload.status.value.isSuccess,
|
|
230
231
|
() => {
|
|
231
|
-
value.value = upload.data.value
|
|
232
|
+
value.value = _get(upload.data.value, props.responseKey || 'url')
|
|
232
233
|
emits('success', upload.data.value)
|
|
233
234
|
}
|
|
234
235
|
)
|
|
@@ -44,7 +44,16 @@
|
|
|
44
44
|
</template>
|
|
45
45
|
|
|
46
46
|
<script lang="tsx" setup>
|
|
47
|
-
import {
|
|
47
|
+
import {
|
|
48
|
+
_get,
|
|
49
|
+
computed,
|
|
50
|
+
ref,
|
|
51
|
+
StringHelper,
|
|
52
|
+
toRef,
|
|
53
|
+
useUI,
|
|
54
|
+
useUiConfig,
|
|
55
|
+
useWatchTrue,
|
|
56
|
+
} from '#imports'
|
|
48
57
|
import { type IUploadFileProps } from './types'
|
|
49
58
|
import FieldWrapper from '#core/components/Form/FieldWrapper.vue'
|
|
50
59
|
import { useFieldHOC } from '#core/composables/useForm'
|
|
@@ -151,7 +160,7 @@ const onDownloadProgress = (progressEvent: ProgressEvent) => {
|
|
|
151
160
|
useWatchTrue(
|
|
152
161
|
() => upload.status.value.isSuccess,
|
|
153
162
|
() => {
|
|
154
|
-
value.value = upload.data.value
|
|
163
|
+
value.value = _get(upload.data.value, props.responseKey || 'url')
|
|
155
164
|
emits('success', upload.data.value)
|
|
156
165
|
}
|
|
157
166
|
)
|