This commit is contained in:
2025-05-09 14:57:18 +08:00
parent 1a7886450d
commit 52a270d27f
15 changed files with 657 additions and 69 deletions

View File

@@ -0,0 +1,30 @@
<script setup>
import Api from "../../api/index.js";
const {api} = defineProps({
api: {
type: Function,
default: Api.system.uploadFile,
}
});
const emits = defineEmits(['success']);
const beforeUpload = (file) => {
api(file).then(({data}) => {
emits('success', data);
});
return false;
}
</script>
<template>
<a-upload @before-upload="beforeUpload" v-bind="$attrs">
<template #upload-button>
<slot name="upload-button"></slot>
</template>
</a-upload>
</template>
<style scoped lang="scss">
</style>