-
Notifications
You must be signed in to change notification settings - Fork 2.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: 约定式路由支持配置额外属性 #10527
feat: 约定式路由支持配置额外属性 #10527
Conversation
The latest updates on your projects. Learn more about Vercel for Git ↗︎ 1 Ignored Deployment
|
跟莺辞老师意见一致 感觉导出类似 clientLoader 的实现更好。如果 icon 支持 组件配置就更好了 那样自定义的布局就不在需要 走 patchRoute 处理了 import { definePageConfig } from 'umi';
export default function SomePage() {
return <div>SomePage</div>;
}
export const pageConfig = definePageConfig({
name: 'hello',
layout: false,
icon: <Hello />
}); |
@AdoKevin 感谢 PR ,我补了剩下的部分。 这个功能要不要默认开启?给第一次进到 PR 的人简介,该功能是使用 import { useRouteProps } from 'umi';
export default function Page() {
const routes: typeof routeProps = useRouteProps();
return (
<div>
index, props: {routes.a}
</div>
);
}
// 注意这里 🟢
export const routeProps = {
a: 1,
}; 目前是配置 默认开启会使用 召唤 @sorrycc @stormslowly @xierenyuan @xiaohuoni 这个 PR 还彻底解了 routes 修改不刷新 icon 的问题已清除掉之前的逻辑 |
Codecov ReportBase: 29.47% // Head: 29.01% // Decreases project coverage by
Additional details and impacted files@@ Coverage Diff @@
## master #10527 +/- ##
==========================================
- Coverage 29.47% 29.01% -0.47%
==========================================
Files 447 452 +5
Lines 13104 13380 +276
Branches 3086 3147 +61
==========================================
+ Hits 3863 3882 +19
- Misses 8595 8837 +242
- Partials 646 661 +15
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here. ☔ View full report at Codecov. |
启用时机改成「约定式路由的时候默认开启」。这个 pr 改动比较大,我先合了,然后手动调整下启用时机。因为今天是发布日,需要早点发 canary 跑 checker 来验项目。 |
@AdoKevin 这个新的 feature 可以加一些 example 来示例 和 e2e 用例保护下 |
似乎又看到了 yaml 哈哈哈哈
|
导致了一个 bug umijs/dumi#1503 |
dumi#1503 已在 #10592 解决。 |
参看 #10423
增加约定式路由读取layout, title, 以及其他额外属性。
改动包括
代码修改
文档增加
扩展路由属性
增加单元测试