鉴于以下
.ts
@RouteConfig([
{ path: '/', name: 'root', redirectTo: ['Home'] },
{ path: '/home', name: 'Home', component: HomeComponent },
{ path: '/about', name: 'About', component: AboutComponent },
{ path: '/contact', name: 'Contact', component: ContactComponent },
{ path: '/protected', name: 'Protected', component: ProtectedComponent },
])
在dart中使用相同的代码会产生很多错误。什么是正确的 Dart 代码?为列表添加const不能更正错误
最佳答案
在Dart中,您需要引用 map 键
{ 'path': '/', 'name': 'root', 'redirectTo': ['Home'] }
关于dart - 如何在Dart中设置@RouteConfig,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/35782824/