[v2 Route] Config Extension #9774
NeverBehave
started this conversation in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
这个是v2 route延展部分,主要针对当前全局配置,并允许插件传递额外传递一些信息用于日后Core配套功能的整合
Layout
所有插件可以在目录声明
config.js
Life Cycle
在首次载入路由的时候,如果插件声明了
config.js
,则动态地载入并尝试初始化变量,config生成的结果将会在ctx.plugin.config
传递给路由,子路由无需require('./config')
,meta内容则会在ctx.plugin.meta
中提供。如果load-config
丢出错误,则直接终止路由载入,并提供错误信息全局变量将会在
ctx.global.config
中暴露Beta Was this translation helpful? Give feedback.
All reactions