chore: remove object spead (#8514)
This commit is contained in:
+21
-11
@@ -1,7 +1,13 @@
|
||||
import { ref, reactive, PropType, defineComponent } from 'vue';
|
||||
|
||||
// Utils
|
||||
import { pick, isPromise, getSizeStyle, ComponentInstance } from '../utils';
|
||||
import {
|
||||
pick,
|
||||
extend,
|
||||
isPromise,
|
||||
getSizeStyle,
|
||||
ComponentInstance,
|
||||
} from '../utils';
|
||||
import {
|
||||
bem,
|
||||
name,
|
||||
@@ -250,12 +256,16 @@ export default defineComponent({
|
||||
.map((item) => item.content || item.url)
|
||||
.filter(Boolean) as string[];
|
||||
|
||||
imagePreview = ImagePreview({
|
||||
images,
|
||||
startPosition: imageFiles.indexOf(item),
|
||||
onClose: onClosePreview,
|
||||
...props.previewOptions,
|
||||
});
|
||||
imagePreview = ImagePreview(
|
||||
extend(
|
||||
{
|
||||
images,
|
||||
startPosition: imageFiles.indexOf(item),
|
||||
onClose: onClosePreview,
|
||||
},
|
||||
props.previewOptions
|
||||
)
|
||||
);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -281,10 +291,10 @@ export default defineComponent({
|
||||
'beforeDelete',
|
||||
] as const;
|
||||
|
||||
const previewData = {
|
||||
...pick(props, needPickData),
|
||||
...pick(item, needPickData, true),
|
||||
};
|
||||
const previewData = extend(
|
||||
pick(props, needPickData),
|
||||
pick(item, needPickData, true)
|
||||
);
|
||||
|
||||
return (
|
||||
<UploaderPreviewItem
|
||||
|
||||
@@ -2,7 +2,7 @@ import { PropType, defineComponent } from 'vue';
|
||||
|
||||
// Utils
|
||||
import { bem, isImageFile, UploaderFileListItem } from './utils';
|
||||
import { isDef, getSizeStyle } from '../utils';
|
||||
import { isDef, getSizeStyle, extend } from '../utils';
|
||||
import { callInterceptor, Interceptor } from '../utils/interceptor';
|
||||
|
||||
// Components
|
||||
@@ -77,7 +77,7 @@ export default defineComponent({
|
||||
const { index, item } = props;
|
||||
return (
|
||||
<div class={bem('preview-cover')}>
|
||||
{slots['preview-cover']({ index, ...item })}
|
||||
{slots['preview-cover'](extend({ index }, item))}
|
||||
</div>
|
||||
);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user