import { ElUpload } from 'element-plus'
export default {
  name: 'CipUpload',
  props: {
    uploadFile: { // 文件上传
      type: Function,
      default: (info) => {}
    },
    accept: { // 可选择文件类型控制
      type: String,
      default: '*/*' // 所有
    },
    multiple: Boolean, // 是否允许多个
    disabled: Boolean // 禁用状态
  },
  setup (props, { slots }) {
    return () => <ElUpload
      class={'cip-upload'}
      action={'uploadAction'}
      httpRequest={props.uploadFile}
      showFileList={false}
      multiple={props.multiple}
      accept={props.accept}
    >
      {{
        default: () => slots.default?.(),
        tip: () => slots.tip?.()
      }}
    </ElUpload>
  }
}
