跳到主要内容

AttachmentSelectorModal

此组件用于调出附件选择器,以供用户选择附件。

仅支持 Console

此组件当前仅在 Console 中可用。

使用示例​

<script lang="ts" setup>
import { ref } from "vue";

const visible = ref(false);

function onAttachmentSelect(attachments: AttachmentLike[]) {
console.log(attachments);
}
</script>

<template>
<VButton @click="visible = true">选择附件</VButton>

<AttachmentSelectorModal
v-model:visible="visible"
@select="onAttachmentSelect"
/>
</template>

Props​

表 1 Props
属性名类型默认值描述
visiblebooleanfalse控制组件是否可见。
acceptsstring[]() => ["*/*"]可选,定义可接受的文件类型。
minnumberundefined可选,定义最小选择数量。
maxnumberundefined可选,定义最大选择数量。

Emits​

表 2 Emits
事件名称参数描述
update:visiblevisible: boolean 类型,表示可见状态。当可见状态更新时触发。
close无当弹框关闭时触发。
selectattachments: AttachmentLike[] 类型,表示附件数组。当选择确定按钮时触发。