refactor(editor): Continue porting components over to composition API (no-changelog) (#8893)

This commit is contained in:
कारतोफ्फेलस्क्रिप्ट™
2024-03-15 12:43:08 +01:00
committed by GitHub
parent 80c4bc443a
commit 6c693e1afd
39 changed files with 989 additions and 1253 deletions

View File

@@ -1,10 +1,13 @@
import type { IMenuItem, RouteObject } from '@/types';
import type { RouteLocationRaw } from 'vue-router';
import type { IMenuItem } from '@/types';
import type { RouteLocationNormalizedLoaded, RouteLocationRaw } from 'vue-router';
/**
* Checks if the given menu item matches the current route.
*/
export function doesMenuItemMatchCurrentRoute(item: IMenuItem, currentRoute: RouteObject) {
export function doesMenuItemMatchCurrentRoute(
item: IMenuItem,
currentRoute: RouteLocationNormalizedLoaded,
) {
let activateOnRouteNames: string[] = [];
if (Array.isArray(item.activateOnRouteNames)) {
activateOnRouteNames = item.activateOnRouteNames;
@@ -20,7 +23,7 @@ export function doesMenuItemMatchCurrentRoute(item: IMenuItem, currentRoute: Rou
}
return (
activateOnRouteNames.includes(currentRoute.name ?? '') ||
activateOnRouteNames.includes((currentRoute.name as string) ?? '') ||
activateOnRoutePaths.includes(currentRoute.path)
);
}