fix(v0.3.0): 框架内 peer 引用回退静态 import + 修 FieldRelativeTime 路径
- 覆盖颗粒度只在 3 个入口: router targets / module routes / field registry - 框架内 .vue 之间互相引用全部硬编码静态 import,resolveVue/defineAsyncComponent 退出 .vue 文件 - 修 components/fields/FieldRelativeTime.vue 的 ../VueAdmin → ../../VueAdmin (移动后未跟改)
This commit is contained in:
+5
-2
@@ -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/<key>.vue 等业务模块
|
||||
// 3. fieldRegistry: components/fields/Field<X>.vue (按文件名导出的字段类型)
|
||||
// 框架内 .vue 之间的 peer 引用是硬编码静态 import,override 颗粒度就停在上面这些"入口"。
|
||||
|
||||
const internalSources = import.meta.glob<Component>('./{components,module}/**/*.vue')
|
||||
const externalSources: Record<string, VueLoader> = {}
|
||||
|
||||
Reference in New Issue
Block a user