fix: improve type safety and error handling in arkts-development
- Replace Record<string, Object> with specific interface types for router params - Add error handling catch block to list-page-template.ets - Add clarification note for router.back() with params - Improve type safety following ArkTS best practices
This commit is contained in:
@@ -96,7 +96,11 @@ router.replaceUrl({ url: 'pages/New' });
|
||||
router.back();
|
||||
|
||||
// Get params
|
||||
const params = router.getParams() as Record<string, Object>;
|
||||
interface RouteParams {
|
||||
id: number;
|
||||
title?: string;
|
||||
}
|
||||
const params = router.getParams() as RouteParams;
|
||||
```
|
||||
|
||||
## Network Request
|
||||
|
||||
Reference in New Issue
Block a user