state,effects,action,reducer都在这个文件夹下:RouterState接口定义在routing-state.ts:继承自ngrxrouter中的RouterReducerState类型,type参数是我们自定义的ActivatedRouterStateSnapshot.export接口ActivatedRouterStateSnapshot{url:string;查询参数:参数;参数:参数;上下文:页面上下文;cmsRequired:布尔值;semanticRoute?:string;}看一个例子:interfacemyType{name:T,value:V};interfacejerryTypeextendsmyType{score:number;}consta:jerryType={name:'杰瑞',价值:1,得分:2};其中,需要定义RouterReducerState的扩展类型时传入state的类型:BaseRouterStoreState类型:只有一个url字段:我们自定义的ActivatedRouterStateSnapshot扩展了BaseRouterStoreState,第一个字段是url:看例子:typejerryType={name:细绳};接口mySuperType{value:T};typesuperJerryType={score:number;name:string;}leta:mySuperType={value:{score:1,name:'Jerry'}};console.log(a);更多Jerry原创文章,尽量在:》王资溪“: