feat: 提交多个新UI组件模块spec和相关属性设定,包括卡片封装、渐变卡片、列式布局组件等,重写了readme.md,用于AI Coding
Some checks are pending
Call HTTPS API / build (push) Waiting to run
Some checks are pending
Call HTTPS API / build (push) Waiting to run
This commit is contained in:
29
AI-Coding/11-Plugins-System.md
Normal file
29
AI-Coding/11-Plugins-System.md
Normal file
@@ -0,0 +1,29 @@
|
||||
# 11. Plugins 系统(library/plugins/*)
|
||||
|
||||
> 目标:明确本仓库“全局注入能力/指令/错误处理”的来源,避免抽取组件时漏掉运行时注入。
|
||||
|
||||
## 插件目录
|
||||
|
||||
- `library/plugins/vab.ts`:全局 gp 注入 + mitt 事件总线(`$pub/$sub/$baseMessage/...`)
|
||||
- `library/plugins/directive.ts`:自定义指令(`v-permissions`)
|
||||
- `library/plugins/errorLog.ts`:全局错误捕获(`app.config.errorHandler`)并写入 store
|
||||
- `library/plugins/support.ts`:构建信息输出与依赖存在性检查
|
||||
|
||||
## 安装方式
|
||||
|
||||
- 正常路径:`library/index.ts` 会自动加载 `library/plugins/**/*.ts` 并 `app.use()`(setupVab 链路内)
|
||||
- 抽取到目标项目:
|
||||
- 若不复用 `library/index.ts` 的自动加载逻辑,需要在入口手动 `app.use(plugin)`
|
||||
|
||||
## 最小依赖闭包
|
||||
|
||||
- `vab.ts`:依赖 Element Plus 全局 API(ElMessage/ElLoading/ElMessageBox/ElNotification)+ lodash + mitt + `src/config`
|
||||
- `directive.ts`:依赖 `src/utils/permission`(hasPermission 及其权限数据来源)
|
||||
- `errorLog.ts`:依赖 `src/store/modules/errorLog` 与 `src/config/errorLog`
|
||||
- `support.ts`:依赖 `__APP_INFO__` 构建注入
|
||||
|
||||
## 验收点(smoke)
|
||||
|
||||
- `vab`:`$baseMessage('ok')` 能弹出 message;`$pub/$sub` 能收发事件
|
||||
- `directive`:模板中 `v-permissions` 不报错且能按权限生效
|
||||
- `errorLog`:手动触发异常能写入 errorLog store
|
||||
Reference in New Issue
Block a user