feat: 封装多图上传组件

Former-commit-id: d36f4fb6fb9e2c3da42518f6689a78ab2370af57
This commit is contained in:
haoxr
2022-11-21 00:03:16 +08:00
parent 6f001a7713
commit fe6669d813
6 changed files with 246 additions and 92 deletions

View File

@@ -24,7 +24,7 @@ import { onBeforeUnmount, shallowRef, reactive, toRefs } from 'vue';
import { Editor, Toolbar } from '@wangeditor/editor-for-vue';
// API 引用
import { uploadFile } from '@/api/file';
import { uploadFileApi } from '@/api/file';
const props = defineProps({
modelValue: {
@@ -46,8 +46,8 @@ const state = reactive({
uploadImage: {
// 自定义图片上传
async customUpload(file: any, insertFn: any) {
uploadFile(file).then(response => {
const url = response.data;
uploadFileApi(file).then(response => {
const url = response.data.url;
insertFn(url);
});
}