简体   繁体   English

object 文字在严格模式下不能有多个同名的属性。 属性“路径”说是重复的

[英]An object literal cannot have multiple properties with the same name in strict mode. The property “path” says to be duplicated

import { CustomerComponenet } from "src/CustomerApp/CustomerApp.component";
import { LoginComponent } from "./LoginApp.component";

export const CustomerRoutes = [{
  path: '',
  component: LoginComponent,
  path: 'Customer',
  component: CustomerComponenet,
  path: 'Login',
  component: LoginComponent
}]

Routes expecting array of paths, it needs to be like this, you forgot to separate path as object需要路径数组的路由,它需要是这样的,你忘记将路径分隔为 object

import { CustomerComponenet } from "src/CustomerApp/CustomerApp.component";
import { LoginComponent } from "./LoginApp.component";

export const CustomerRoutes = [{
    path: '',
    component: LoginComponent
  },
  {
    path: 'Customer',
    component: CustomerComponenet
  },
  {
    path: 'Login',
    component: LoginComponent
  }
]

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 严格模式下不允许属性的多个定义-Angular - Multiple definitions of a property not allowed in strict mode - Angular 类型文字属性在TypeScript中不能有初始值设定项 - A type literal property cannot have an initializer in TypeScript 模块解析失败:严格模式下的八进制文字 - Module parse failed: Octal literal in strict mode @Input()属性无法访问因为它在Undefined Angular 2中说明了对象 - @Input() Properties Cannot Be Accessed Because It Says The Object In Undefined Angular 2 Angular 2+:IE11中严格模式下不允许的属性的多个定义 - Angular 2+: Multiple definitions of a property not allowed in strict mode in IE11 对象属性返回文字的一部分 - Object property returns part of literal Angular 错误值在多选模式下必须是数组。 垫选择多个 - Angular Error Value must be an array in multiple-selection mode. mat selection multiple 对象文字只能指定已知属性 - Object Literal May Only Specify Known Properties 在angular 2中使用正则表达式时出错,模块解析失败:严格模式下的八进制文字 - error while using regular expression in angular 2 , Module parse failed : Octal literal in strict mode Typescript 严格模式无法将 Observable async 分配给 primeNg 下拉组件 - Typescript strict mode cannot assign Observable async to primeNg dropdown component
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM