From 0416ac336080e6edcf13b606dd77b9b0f1e62fdc Mon Sep 17 00:00:00 2001 From: qubiaobiao <3294694717@qq.com> Date: Tue, 29 Sep 2026 12:01:57 +0800 Subject: [PATCH] =?UTF-8?q?fix(frontend):=20Upload.vue=203=20=E5=A4=84=20h?= =?UTF-8?q?('el-button')=20=E6=94=B9=E4=B8=BA=E6=98=BE=E5=BC=8F=20ElButton?= =?UTF-8?q?=EF=BC=88BACKLOG=20B1=EF=BC=89?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 修复前:Vue3 中 h('el-button') 的字符串标签不解析为组件,创建原生自定义元素 ⇒ 无 EP 样式 · type/circle/text 失效 · 「开始上传」的 loading 与 primary 全失效(点击后无进行中反馈)· icon: h(Delete) 被写成垃圾属性。 修法:ElButton 已在同文件 309 行导入 ⇒ 3 处字符串改标识符(ElProgress/ElTag/ ElIcon 已在 R36 迁移)。最小改动:3 insertions / 3 deletions。 验证(新增 perf-r34/upload-check.mjs:静态服务 + 真后端代理 + 真 chromium + 拦截 POST /api/upload/** 防真实写库): 18/18 全绿 —— 「开始上传」cls='el-button el-button--primary is-loading' bg=rgb(26,58,92) == --el-color-primary · 删除按钮 is-circle+el-button--danger · 「重新上传」is-text+el-button--danger · 0 个原生 el-button 自定义元素 · 0 Failed to resolve · 0 pageerror · 2 个写请求被拦截(零真实写库) TDZ 扫描 38 文件 PASS · vite build exit 0 ⚠️ 另发现(不在本次修复范围,见 BACKLOG B2):/upload 是全仓零 UI 入口的 孤儿路由,且对中职/高职会调用后端不支持的分组接口(3 条 console 错误)。 --- src/views/Upload.vue | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/views/Upload.vue b/src/views/Upload.vue index 4d4e0a7..5659b01 100644 --- a/src/views/Upload.vue +++ b/src/views/Upload.vue @@ -467,7 +467,7 @@ const FileUploadArea = defineComponent({ // 已选文件 fileList.value.length > 0 ? h('div', { class: 'selected-file' }, [ h('span', { class: 'selected-name' }, fileList.value[0].name || fileList.value[0].fileName), - h('el-button', { + h(ElButton, { type: 'danger', size: 'small', icon: h(Delete), @@ -478,7 +478,7 @@ const FileUploadArea = defineComponent({ // 上传按钮 fileList.value.length > 0 ? h('div', { class: 'upload-actions' }, [ - h('el-button', { + h(ElButton, { type: 'primary', loading: uploading.value, onClick: startUpload, @@ -502,7 +502,7 @@ const FileUploadArea = defineComponent({ h('span', null, formatFileSize(uploadedInfo.value.fileSize)), uploadedInfo.value.md5 ? h('span', null, `MD5: ${uploadedInfo.value.md5.slice(0, 16)}...`) : null, ].filter(Boolean)), - h('el-button', { + h(ElButton, { text: true, type: 'danger', size: 'small',