ant-design-vue/components/upload/Dragger.tsx

23 lines
657 B
Vue
Raw Normal View History

2020-10-22 06:52:37 +00:00
import { defineComponent } from 'vue';
2019-01-12 03:33:27 +00:00
import Upload from './Upload';
2021-12-17 07:32:32 +00:00
import { uploadProps } from './interface';
2018-04-13 08:19:50 +00:00
2020-10-22 06:52:37 +00:00
export default defineComponent({
name: 'AUploadDragger',
2020-06-25 14:21:23 +00:00
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>;
};
2018-04-13 08:19:50 +00:00
},
2020-10-22 06:52:37 +00:00
});