30 lines
1006 B
YAML
30 lines
1006 B
YAML
|
|
# Module Spec:plugin-vab(全局能力注入 + 事件总线)
|
|||
|
|
|
|||
|
|
module:
|
|||
|
|
id: plugin-vab
|
|||
|
|
name: Vab 插件(gp 全局方法 + mitt 事件总线)
|
|||
|
|
type: plugin
|
|||
|
|
entrypoints:
|
|||
|
|
- library/plugins/vab.ts
|
|||
|
|
|
|||
|
|
public_api:
|
|||
|
|
concept:
|
|||
|
|
- "通过 app.provide + app.config.globalProperties 注入 gp($baseLoading/$baseMessage/$baseAlert/$baseConfirm/$baseNotify/$baseTableHeight/$pub/$sub/$unsub)"
|
|||
|
|
- "内部使用 mitt 作为事件总线实现 $pub/$sub/$unsub"
|
|||
|
|
|
|||
|
|
dependency_closure:
|
|||
|
|
runtime:
|
|||
|
|
- "Element Plus:ElLoading / ElMessage / ElMessageBox / ElNotification"
|
|||
|
|
- "mitt"
|
|||
|
|
- "lodash"
|
|||
|
|
- "src/config(loadingText/messageDuration)"
|
|||
|
|
types:
|
|||
|
|
- "types/library.d.ts(globalPropertiesType)"
|
|||
|
|
|
|||
|
|
acceptance:
|
|||
|
|
- "安装插件后,可通过 inject('$pub')/this.$pub 发布事件"
|
|||
|
|
- "$baseMessage/$baseLoading 能正常工作"
|
|||
|
|
|
|||
|
|
pitfalls:
|
|||
|
|
- "生产环境存在授权/依赖检查逻辑,可能将 app.config.globalProperties 置空(不要在外部假设 gp 永远存在)"
|