feat: 模型的文件上传

This commit is contained in:
砂糖
2025-09-29 13:38:10 +08:00
parent bb325bcfbf
commit 89be8981ff
5 changed files with 37 additions and 9 deletions

View File

@@ -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--;