import type { RouteLocation } from 'vue-router'; import type { INavLinkItem, ISelectItem } from '../../types'; /** Возвращает значение query выбранного элемента из items, совпадающего с текущим маршрутом. */ export function getSelectedQuery(route: RouteLocation, items: INavLinkItem[] | ISelectItem[]) { return items.find(item => item.value === route.query[item.key || ''])?.query; }