API 文档 / RouteRecordRedirect
接口: RouteRecordRedirect
定义重定向的路由记录。不能有 component 或 components,因为它永远不会被渲染。
层次结构
↳
RouteRecordRedirect
属性
alias
• 可选 alias: string | string[]
记录的别名。允许定义额外的路径,这些路径的行为类似于记录的副本。允许使用路径缩写,例如 /users/:id 和 /u/:id。所有 alias 和 path 值必须共享相同的参数。
继承自
beforeEnter
• 可选 beforeEnter: NavigationGuardWithThis<undefined> | NavigationGuardWithThis<undefined>[]
特定于此记录的进入前守卫。注意,如果记录具有 redirect 属性,则 beforeEnter 不会生效。
继承自
children
• 可选 children: RouteRecordRaw[]
嵌套路由数组。
继承自
component
• 可选 component: undefined
components
• 可选 components: undefined
end
• 可选 end: boolean
是否应该通过在 RegExp 后面追加 $ 来匹配到末尾。
默认值
true
继承自
meta
• 可选 meta: RouteMeta
附加到记录的任意数据。
继承自
name
• 可选 name: RouteRecordNameGeneric
路由记录的名称。必须是唯一的。
继承自
path
• path: string
记录的路径。应该以 / 开头,除非记录是另一个记录的子记录。
示例
`/users/:id` matches `/users/1` as well as `/users/posva`.继承自
props
• 可选 props: undefined
允许将参数作为 props 传递给由 router-view 渲染的组件。
覆盖
redirect
• redirect: RouteRecordRedirectOption
如果直接匹配到路由,则重定向到哪里。重定向发生在任何导航守卫之前,并使用新的目标位置触发新的导航。
覆盖
sensitive
• 可选 sensitive: boolean
使 RegExp 区分大小写。
默认值
false
继承自
strict
• 可选 strict: boolean
是否允许或禁止尾部斜杠。
默认值
false