我正在关注用于路由的 Spartacus 训练营示例https://github.com/SAP/spartacus-bootcamp/tree/77b7474c9538eaa1032062ad3c6d461fb1fc7517/src/app/features/routing
我的问题是当我配置了自定义 PDP
imports: [
CommonModule,
// dependent module for semantic URLs like cxUrl
UrlModule,
// standard non-spartacus routes
RouterModule.forChild(staticRoutes),
// configure product routes
ConfigModule.withConfig({
routing: {
routes: {
product: {
paths: [
'product/:manufacturer/:firstCategoryName/:productCode/:prettyName',
'product/:manufacturer/:productCode/:prettyName',
'product/:productCode/:name',
],
},
},
},
} as RoutingConfig),
//code mapping in the routes
ConfigModule.withConfig({
paramsMapping: {
productCode: 'code',
},
} as RouteConfig),
新的 PDP 路由从未在 Storefront 中使用。我可以在浏览器控制台中看到自定义产品属性 firstCategoryName 和 prettyName 已从示例的规范化器/转换器中正确解决...
任何见解会发生什么?
谢谢!
费尔南多