mirror of
https://gitee.com/ccnetcore/Yi
synced 2026-04-26 11:17:56 +08:00
feat(project): 添加vben5前端
This commit is contained in:
@@ -0,0 +1,37 @@
|
||||
<script setup lang="ts">
|
||||
import { ref } from 'vue';
|
||||
|
||||
import { useVbenModal } from '@vben/common-ui';
|
||||
|
||||
import { ImageUpload } from '#/components/upload';
|
||||
|
||||
const emit = defineEmits<{ reload: [] }>();
|
||||
|
||||
const fileList = ref<string[]>([]);
|
||||
const [BasicModal, modalApi] = useVbenModal({
|
||||
onOpenChange: (isOpen) => {
|
||||
if (isOpen) {
|
||||
return null;
|
||||
}
|
||||
if (fileList.value.length > 0) {
|
||||
fileList.value = [];
|
||||
emit('reload');
|
||||
modalApi.close();
|
||||
return null;
|
||||
}
|
||||
},
|
||||
});
|
||||
</script>
|
||||
|
||||
<template>
|
||||
<BasicModal
|
||||
:close-on-click-modal="false"
|
||||
:footer="false"
|
||||
:fullscreen-button="false"
|
||||
title="图片上传"
|
||||
>
|
||||
<div class="flex flex-col gap-4">
|
||||
<ImageUpload v-model:value="fileList" :max-count="3" />
|
||||
</div>
|
||||
</BasicModal>
|
||||
</template>
|
||||
Reference in New Issue
Block a user