bowen
2023-11-02 beed7f2e1172531fe691384a50c8b0457f3a80d8
src/components/Upload/src/props.ts
@@ -1,6 +1,18 @@
import type { PropType } from 'vue';
import { FileBasicColumn } from './typing';
import type { Options } from 'sortablejs';
import { Merge } from '/@/utils/types';
type SortableOptions = Merge<
  Omit<Options, 'onEnd'>,
  {
    onAfterEnd?: <T = any, R = any>(params: T) => R;
    // ...可扩展
  }
>;
export const basicProps = {
  helpText: {
    type: String as PropType<string>,
@@ -42,6 +54,15 @@
    type: String as PropType<string>,
    default: null,
  },
  fileListOpenDrag: {
    type: Boolean,
    default: true,
  },
  fileListDragOptions: {
    type: Object as PropType<SortableOptions>,
    default: () => ({}),
  },
};
export const uploadContainerProps = {
@@ -80,4 +101,12 @@
    type: Array as PropType<any[]>,
    default: null,
  },
  openDrag: {
    type: Boolean,
    default: false,
  },
  dragOptions: {
    type: Object as PropType<SortableOptions>,
    default: () => ({}),
  },
};