2020-10-22 14:52:37 +08:00
|
|
|
import { defineComponent } from 'vue';
|
2019-01-12 11:33:27 +08:00
|
|
|
import Upload from './Upload';
|
2021-12-17 15:32:32 +08:00
|
|
|
import { uploadProps } from './interface';
|
2018-04-13 16:19:50 +08:00
|
|
|
|
2020-10-22 14:52:37 +08:00
|
|
|
export default defineComponent({
|
2022-09-26 21:33:41 +08:00
|
|
|
compatConfig: { MODE: 3 },
|
2018-05-06 21:52:16 +08:00
|
|
|
name: 'AUploadDragger',
|
2020-06-25 22:21:23 +08:00
|
|
|
inheritAttrs: false,
|
2022-02-24 09:58:58 +08:00
|
|
|
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 16:19:50 +08:00
|
|
|
},
|
2020-10-22 14:52:37 +08:00
|
|
|
});
|