Skip to content

Commit

Permalink
feat: add component alias to EditableTreeNode
Browse files Browse the repository at this point in the history
  • Loading branch information
posva committed May 20, 2024
1 parent 7f23f46 commit fc8ae27
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/core/extendRoutes.ts
Original file line number Diff line number Diff line change
Expand Up @@ -66,12 +66,20 @@ export class EditableTreeNode {

/**
* Return a Map of the files associated to the current route. The key of the map represents the name of the view (Vue
* Router feature) while the value is the file path. By default, the name of the view is `default`.
* Router feature) while the value is the **resolved** file path.
* By default, the name of the view is `default`.
*/
get components() {
return this.node.value.components
}

/**
* Alias for `route.components.get('default')`.
*/
get component() {
return this.node.value.components.get('default')
}

/**
* Name of the route. Note that **all routes are named** but when the final `routes` array is generated, routes
* without a `component` will not include their `name` property to avoid accidentally navigating to them and display
Expand Down

0 comments on commit fc8ae27

Please sign in to comment.