typescript 错误 , 这里给大家说一下解决方法
你可能创建了一个装饰器:
export class A{
@Inject()
private b!: string
@Inject()
private c!: string
}
然后出现了报错
export class A{
@Inject()
private b!: string
@Inject() //error : Decorators must precede the name and all keywords of property declarations. ts(1436)
private c!: string
}
解决方法
在属性后面加一个 分号 ;
export class A{
@Inject()
private b!: string ;
@Inject()
private c!: string ;
}