From de18412010f61955b349c3c10c4211a3b09c072b Mon Sep 17 00:00:00 2001 From: wc24 Date: Mon, 25 May 2026 17:33:44 +0800 Subject: [PATCH] =?UTF-8?q?fix(v0.3.0):=20=E6=A1=86=E6=9E=B6=E5=86=85=20pe?= =?UTF-8?q?er=20=E5=BC=95=E7=94=A8=E5=9B=9E=E9=80=80=E9=9D=99=E6=80=81=20i?= =?UTF-8?q?mport=20+=20=E4=BF=AE=20FieldRelativeTime=20=E8=B7=AF=E5=BE=84?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit - 覆盖颗粒度只在 3 个入口: router targets / module routes / field registry - 框架内 .vue 之间互相引用全部硬编码静态 import,resolveVue/defineAsyncComponent 退出 .vue 文件 - 修 components/fields/FieldRelativeTime.vue 的 ../VueAdmin → ../../VueAdmin (移动后未跟改) --- src/VueAdmin.ts | 7 +++++-- src/components/ShrimpTable.vue | 13 ++++++------- src/components/fields/FieldRelativeTime.vue | 2 +- src/components/layout.vue | 15 +++++++-------- src/components/login.vue | 7 +++---- src/components/sideM.vue | 9 ++++----- src/components/userbar.vue | 6 ++---- src/index.ts | 3 +-- src/module/role.vue | 7 +++---- src/module/user.vue | 7 ++----- src/module/user/operationLog.vue | 7 +++---- 11 files changed, 37 insertions(+), 46 deletions(-) diff --git a/src/VueAdmin.ts b/src/VueAdmin.ts index cc51f9f..85e7fbd 100644 --- a/src/VueAdmin.ts +++ b/src/VueAdmin.ts @@ -57,8 +57,11 @@ export interface ShrimpAdminOptions { // ============== 源注册表 ============== // -// 唯一约定:消费侧把 .vue 源放进 `sources`,框架按文件路径后缀解析。 -// 框架内部对可覆盖的 .vue 也用 resolveVue 解析(而不是静态 import),保证 consumer 覆盖在框架内部使用点也生效。 +// 框架在 3 个入口点用消费侧 sources 覆盖内置(按路径后缀同后缀覆盖): +// 1. router: components/{layout,login,404}.vue +// 2. registerRoute: module/.vue 等业务模块 +// 3. fieldRegistry: components/fields/Field.vue (按文件名导出的字段类型) +// 框架内 .vue 之间的 peer 引用是硬编码静态 import,override 颗粒度就停在上面这些"入口"。 const internalSources = import.meta.glob('./{components,module}/**/*.vue') const externalSources: Record = {} diff --git a/src/components/ShrimpTable.vue b/src/components/ShrimpTable.vue index 478ac94..9c8fc1b 100644 --- a/src/components/ShrimpTable.vue +++ b/src/components/ShrimpTable.vue @@ -78,22 +78,21 @@