作者:无声无无为爱 | 来源:互联网 | 2023-10-10 20:05
RouteConfig的类型定义:interfaceRouteConfig{path:string,component?:Component,name?:string,命名路由co
RouteConfig 的类型定义:
interface RouteCOnfig= { path: string, component?: Component, name?: string, // 命名路由 components?: { [name: string]: Component }, // 命名视图组件 redirect?: string | Location | Function, props?: boolean | Object | Function, alias?: string | Array, children?: Array, // 嵌套路由 beforeEnter?: (to: Route, from: Route, next: Function) => void, meta?: any, // 2.6.0+ caseSensitive?: boolean, // 匹配规则是否大小写敏感?(默认值:false) pathToRegexpOptions?: Object // 编译正则的选项 }
参数具体作用见官方文档 https://router.vuejs.org/zh/api/#base