Skip to content

Commit fc8ae27

Browse files
committed
feat: add component alias to EditableTreeNode
1 parent 7f23f46 commit fc8ae27

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

src/core/extendRoutes.ts

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -66,12 +66,20 @@ export class EditableTreeNode {
6666

6767
/**
6868
* Return a Map of the files associated to the current route. The key of the map represents the name of the view (Vue
69-
* Router feature) while the value is the file path. By default, the name of the view is `default`.
69+
* Router feature) while the value is the **resolved** file path.
70+
* By default, the name of the view is `default`.
7071
*/
7172
get components() {
7273
return this.node.value.components
7374
}
7475

76+
/**
77+
* Alias for `route.components.get('default')`.
78+
*/
79+
get component() {
80+
return this.node.value.components.get('default')
81+
}
82+
7583
/**
7684
* Name of the route. Note that **all routes are named** but when the final `routes` array is generated, routes
7785
* without a `component` will not include their `name` property to avoid accidentally navigating to them and display

0 commit comments

Comments
 (0)