1
0
Files
AstralRinth/apps/frontend/src/composables/route-params.js
Evan Song abec2e48d4 Add TailwindCSS (#1252)
* Setup TailwindCSS

* Fully setup configuration

* Refactor some tailwind variables
2024-07-06 20:57:32 -07:00

12 lines
359 B
JavaScript

/* eslint-disable no-undef */
/**
* Extracts the [id] from the route params and returns it as a ref.
*
* @param {string?} key The key of the route param to extract.
* @returns {import('vue').Ref<string | string[] | undefined>}
*/
export const useRouteId = (key = "id") => {
const route = useNativeRoute();
return route.params?.[key] || undefined;
};