2020-10-22 06:52:37 +00:00
|
|
|
import { defineComponent } from 'vue';
|
2020-06-25 14:21:23 +00:00
|
|
|
import { getOptionProps, getSlot } from '../_util/props-util';
|
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({
|
2018-05-06 13:52:16 +00:00
|
|
|
name: 'AUploadDragger',
|
2020-06-25 14:21:23 +00:00
|
|
|
inheritAttrs: false,
|
2021-12-17 07:32:32 +00:00
|
|
|
props: uploadProps,
|
2019-01-12 03:33:27 +00:00
|
|
|
render() {
|
|
|
|
const props = getOptionProps(this);
|
2020-06-25 14:21:23 +00:00
|
|
|
const { height, ...restProps } = props;
|
|
|
|
const { style, ...restAttrs } = this.$attrs;
|
2018-04-13 08:19:50 +00:00
|
|
|
const draggerProps = {
|
2020-06-25 14:21:23 +00:00
|
|
|
...restProps,
|
|
|
|
...restAttrs,
|
|
|
|
type: 'drag',
|
2020-10-22 06:52:37 +00:00
|
|
|
style: { ...(style as any), height },
|
|
|
|
} as any;
|
2020-06-25 14:21:23 +00:00
|
|
|
return <Upload {...draggerProps}>{getSlot(this)}</Upload>;
|
2018-04-13 08:19:50 +00:00
|
|
|
},
|
2020-10-22 06:52:37 +00:00
|
|
|
});
|