✨ feat: 模型的文件上传
This commit is contained in:
@@ -62,6 +62,11 @@ const props = defineProps({
|
||||
isShowTip: {
|
||||
type: Boolean,
|
||||
default: true
|
||||
},
|
||||
// 存储字段
|
||||
storeField: {
|
||||
type: String,
|
||||
default: 'url'
|
||||
}
|
||||
});
|
||||
|
||||
@@ -139,7 +144,7 @@ function handleUploadError(err) {
|
||||
// 上传成功回调
|
||||
function handleUploadSuccess(res, file) {
|
||||
if (res.code === 200) {
|
||||
uploadList.value.push({ name: res.fileName, url: res.fileName });
|
||||
uploadList.value.push({ name: res[props.storeField], url: res[props.storeField] });
|
||||
uploadedSuccessfully();
|
||||
} else {
|
||||
number.value--;
|
||||
|
||||
Reference in New Issue
Block a user