|
|
@ -10,15 +10,16 @@ import Button from '../../button';
|
|
|
|
import ListItem from './ListItem';
|
|
|
|
import ListItem from './ListItem';
|
|
|
|
import type { HTMLAttributes } from 'vue';
|
|
|
|
import type { HTMLAttributes } from 'vue';
|
|
|
|
import { computed, defineComponent, getCurrentInstance, onMounted, ref, watchEffect } from 'vue';
|
|
|
|
import { computed, defineComponent, getCurrentInstance, onMounted, ref, watchEffect } from 'vue';
|
|
|
|
import { initDefaultProps, isValidElement } from '../../_util/props-util';
|
|
|
|
import { filterEmpty, initDefaultProps, isValidElement } from '../../_util/props-util';
|
|
|
|
import type { VueNode } from '../../_util/type';
|
|
|
|
import type { VueNode } from '../../_util/type';
|
|
|
|
import useConfigInject from '../../_util/hooks/useConfigInject';
|
|
|
|
import useConfigInject from '../../_util/hooks/useConfigInject';
|
|
|
|
import { getTransitionGroupProps, TransitionGroup } from '../../_util/transition';
|
|
|
|
import { getTransitionGroupProps, TransitionGroup } from '../../_util/transition';
|
|
|
|
import collapseMotion from '../../_util/collapseMotion';
|
|
|
|
import collapseMotion from '../../_util/collapseMotion';
|
|
|
|
|
|
|
|
|
|
|
|
const HackSlot = (_, { slots }) => {
|
|
|
|
const HackSlot = (_, { slots }) => {
|
|
|
|
return slots.default?.()[0];
|
|
|
|
return filterEmpty(slots.default?.())[0];
|
|
|
|
};
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
export default defineComponent({
|
|
|
|
export default defineComponent({
|
|
|
|
name: 'AUploadList',
|
|
|
|
name: 'AUploadList',
|
|
|
|
props: initDefaultProps(uploadListProps(), {
|
|
|
|
props: initDefaultProps(uploadListProps(), {
|
|
|
@ -166,11 +167,11 @@ export default defineComponent({
|
|
|
|
previewIcon,
|
|
|
|
previewIcon,
|
|
|
|
downloadIcon,
|
|
|
|
downloadIcon,
|
|
|
|
progress,
|
|
|
|
progress,
|
|
|
|
appendAction = slots.appendAction,
|
|
|
|
appendAction,
|
|
|
|
itemRender,
|
|
|
|
itemRender,
|
|
|
|
appendActionVisible,
|
|
|
|
appendActionVisible,
|
|
|
|
} = props;
|
|
|
|
} = props;
|
|
|
|
const appendActionDom = appendAction?.()[0];
|
|
|
|
const appendActionDom = appendAction?.();
|
|
|
|
return (
|
|
|
|
return (
|
|
|
|
<TransitionGroup {...transitionGroupProps.value} tag="div">
|
|
|
|
<TransitionGroup {...transitionGroupProps.value} tag="div">
|
|
|
|
{items.map(file => {
|
|
|
|
{items.map(file => {
|
|
|
@ -203,8 +204,12 @@ export default defineComponent({
|
|
|
|
/>
|
|
|
|
/>
|
|
|
|
);
|
|
|
|
);
|
|
|
|
})}
|
|
|
|
})}
|
|
|
|
{appendActionVisible && isValidElement(appendActionDom) ? (
|
|
|
|
{appendAction ? (
|
|
|
|
<HackSlot key="__ant_upload_appendAction">{appendActionDom}</HackSlot>
|
|
|
|
<HackSlot
|
|
|
|
|
|
|
|
key="__ant_upload_appendAction"
|
|
|
|
|
|
|
|
v-show={!!appendActionVisible}
|
|
|
|
|
|
|
|
v-slots={{ default: () => appendActionDom }}
|
|
|
|
|
|
|
|
></HackSlot>
|
|
|
|
) : null}
|
|
|
|
) : null}
|
|
|
|
</TransitionGroup>
|
|
|
|
</TransitionGroup>
|
|
|
|
);
|
|
|
|
);
|
|
|
|