In the project, the framework provides a basic routing system and **automatically generates the corresponding menu structure based on the routing file**.
## Route Types
Routes are divided into static routes and dynamic routes. Static routes are routes that have been determined when the project starts. Dynamic routes are generally routes that are dynamically generated based on the user's permissions after the user logs in.
### Static Routes
If your page project does not require permission control, you can directly use static routes. The configuration of static routes is in the `src/router/routes/index` directory under the application. Open the commented file content:
```ts
// If necessary, you can open your own comments and create folders
The configuration of dynamic routing is in the corresponding application `src/router/routes/modules` directory. All routing files are stored in this directory. The content format of each file is as follows, which is consistent with the routing configuration format of Vue Router. The following is the configuration of secondary routes and multi-level routes.
## Define the route
Static routes and dynamic routes are configured in the same way. The configuration of the level-2 and multi-level routes is as follows:
- The parent route of multi-level routing does not need to set the 'component' attribute, only the 'children' attribute needs to be set. Unless you really need to display content under nested parent routing.
- If there are no special circumstances, the 'redirect' attribute of the parent route does not need to be specified and will default to the first child route.
Used to configure the page title, which will be displayed in the menu and tabs. It is generally used in conjunction with internationalization.
### icon
- Type: `string`
- Default value: `''`
Used to configure the page icon, which will be displayed in the menu and tabs. It is generally used in conjunction with an icon library. If it is an `http` link, the image will be automatically loaded.
### activeIcon
- Type: `string`
- Default value: `''`
Used to configure the active icon of the page, which will be displayed in the menu. It is generally used in conjunction with an icon library. If it is an `http` link, the image will be automatically loaded.
### keepAlive
- Type: `boolean`
- Default value: `false`
Used to configure whether the page caching is enabled. Once enabled, the page will be cached and not reloaded, only effective when tabs are enabled.
### hideInMenu
- Type: `boolean`
- Default value: `false`
Used to configure whether the page is hidden in the menu. If hidden, the page will not be displayed in the menu.
### hideInTab
- Type: `boolean`
- Default value: `false`
Used to configure whether the page is hidden in tabs. If hidden, the page will not be displayed in tabs.
### hideInBreadcrumb
- Type: `boolean`
- Default value: `false`
Used to configure whether the page is hidden in the breadcrumb. If hidden, the page will not be displayed in the breadcrumb.
### hideChildrenInMenu
- Type: `boolean`
- Default value: `false`
Used to configure whether the child pages of the page are hidden in the menu. If hidden, the child pages will not be displayed in the menu.
### authority
- Type: `string[]`
- Default value: `[]`
Used to configure the page's permissions. Only users with corresponding permissions can access the page. If not configured, no permissions are required.
### badge
- Type: `string`
- Default value: `''`
Used to configure the page's badge, which will be displayed in the menu.
### badgeType
- Type: `'dot' | 'normal'`
- Default value: `'normal'`
Used to configure the type of the page's badge. `dot` is a small red dot, `normal` is text.
Used to configure the currently active menu. Sometimes when the page is not displayed in the menu, it is used to activate the parent menu.
### affixTab
- Type: `boolean`
- Default value: `false`
Used to configure whether the page tab is pinned. Once pinned, the page cannot be closed.
### affixTabOrder
- Type: `number`
- Default value: `0`
Used to configure the order of the pinned page tabs, sorted in ascending order.
### iframeSrc
- Type: `string`
- Default value: `''`
Used to configure the `iframe` address of the embedded page. Once set, the corresponding page will be embedded in the current page.
### ignoreAccess
- Type: `boolean`
- Default value: `false`
Used to configure whether the page ignores permissions and can be accessed directly.
### link
- Type: `string`
- Default value: `''`
Used to configure the external link jump path, which will be opened in a new window.
### maxNumOfOpenTab
- Type: `number`
- Default value: `-1`
Used to configure the maximum number of open tabs. Once set, the earliest opened tab will be automatically closed when a new tab is opened (only effective when opening tabs with the same name).
### menuVisibleWithForbidden
- Type: `boolean`
- Default value: `false`
Used to configure whether the page can be seen in the menu, but access will be redirected to 403.
### order
- Type: `number`
- Default value: `0`
Used to configure the page's order, for routing to menu sorting.