ant-design-vue/components/upload/Dragger.tsx
tangjinzhou 04baae5a57
Refactor upload (#5290)
* refactor: vc-upload

* refactor: vc-upload

* refactor: upload

* refactor: upload

* refactor: upload
2022-02-24 09:58:58 +08:00

23 lines
657 B
Vue

import { defineComponent } from 'vue';
import Upload from './Upload';
import { uploadProps } from './interface';
export default defineComponent({
name: 'AUploadDragger',
inheritAttrs: false,
props: uploadProps(),
setup(props, { slots, attrs }) {
return () => {
const { height, ...restProps } = props;
const { style, ...restAttrs } = attrs;
const draggerProps = {
...restProps,
...restAttrs,
type: 'drag',
style: { ...(style as any), height: typeof height === 'number' ? `${height}px` : height },
} as any;
return <Upload {...draggerProps} v-slots={slots}></Upload>;
};
},
});