You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
This file contains ambiguous Unicode characters that may be confused with others in your current locale. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to highlight these characters.
<!--
CO_OP_TRANSLATOR_METADATA:
{
"original_hash": "8223e429218befa731dd5bfd22299520",
"translation_date": "2025-08-24T00:09:43+00:00",
"source_file": "7-bank-project/1-template-route/assignment.md",
"language_code": "zh"
}
-->
# 改进路由
## 说明
当前的路由声明仅包含模板 ID, 但在显示新页面时, 有时需要更多内容。让我们通过以下两个功能来改进路由实现:
- 为每个模板设置标题,并在模板更改时更新窗口标题为新标题。
- 添加一个选项,在模板更改后运行一些代码。我们希望每次显示仪表盘页面时,在开发者控制台打印 `'Dashboard is shown'` 。
## 评分标准
| 标准 | 卓越 | 合格 | 需要改进 |
| -------- | ---------------------------------------------------------------------------------------------------------------------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------- |
| | 两个功能均已实现并正常工作。标题和代码添加功能也适用于在 `routes` 声明中新增的路由。 | 两个功能正常工作,但行为是硬编码的,无法通过 `routes` 声明进行配置。添加第三个带标题和代码功能的路由无法正常工作或仅部分工作。 | 缺少一个功能或某个功能未正常工作。 |
** 免责声明**:
本文档使用AI翻译服务 [Co-op Translator ](https://github.com/Azure/co-op-translator ) 进行翻译。尽管我们努力确保翻译的准确性,但请注意,自动翻译可能包含错误或不准确之处。应以原始语言的文档作为权威来源。对于关键信息,建议使用专业人工翻译。因使用本翻译而引起的任何误解或误读,我们概不负责。