update
This commit is contained in:
@@ -1,17 +1,21 @@
|
||||
<script setup>
|
||||
import Api from "../../api/index.js";
|
||||
|
||||
const {size} = defineProps({
|
||||
const {size, api} = defineProps({
|
||||
size: {
|
||||
type: String,
|
||||
default: '100%'
|
||||
},
|
||||
api: {
|
||||
type: Function,
|
||||
default: Api.system.uploadFile,
|
||||
}
|
||||
});
|
||||
const emits = defineEmits(['success']);
|
||||
const files = defineModel('file');
|
||||
|
||||
const beforeUpload = (file) => {
|
||||
Api.system.uploadFile(file).then(({data}) => {
|
||||
api(file).then(({data}) => {
|
||||
files.value = data;
|
||||
emits('success', file);
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user